← Back to Plugins
Voice

Plugin Mcpgram

Aryan418-dev By Aryan418-dev 👁 22 views ▲ 0 votes

OpenClaw plugin connecting to MCPGRAM β€” lets an OpenClaw agent discover and call any native connector or external MCP server in an MCPGRAM workspace.

GitHub

Install

npm install
npm

Configuration Example

{
  "plugins": {
    "mcpgram": {
      "apiKey": "mcpg_live_...",
      "baseUrl": "https://your-mcpgram-deployment.example.com"
    }
  }
}

README

# openclaw-plugin-mcpgram

OpenClaw plugin for **MCPGRAM** β€” lets an OpenClaw agent discover and call any native connector (GitHub, Slack, Notion, Google Drive) or external MCP server connected to an MCPGRAM workspace.

This is Phase 3, step 6. Unlike the Claude/OpenAI/LangGraph/CrewAI adapters (`mcpgram-sdk`, `mcpgram-sdk-py`), OpenClaw isn't a library you import tool objects into β€” it's a standalone daemon that discovers plugin tools from static build-time metadata. See "Why two tools, not one per connector" below for why this plugin is shaped differently from the others.

## Install

```bash
openclaw plugins install ./openclaw-plugin-mcpgram   # from a local checkout
# or, once published:
openclaw plugins install clawhub:your-org/openclaw-plugin-mcpgram
```

Then configure it in your Gateway config with your workspace's API key and MCPGRAM deployment URL:

```jsonc
{
  "plugins": {
    "mcpgram": {
      "apiKey": "mcpg_live_...",
      "baseUrl": "https://your-mcpgram-deployment.example.com"
    }
  }
}
```

Restart or reload the Gateway after installing/configuring.

## Tools this plugin adds

- **`mcpgram_list_tools`** β€” lists tools in the connected workspace (optionally filtered by connector/server name, e.g. `"github"`). Returns each tool's `tool_id`, `name`, `description`, and `input_schema`.
- **`mcpgram_call_tool`** β€” executes a tool by `tool_id` (from `mcpgram_list_tools`) with matching `input`.

## Why two tools, not one per connector

`defineToolPlugin` needs a fixed, known-at-build-time list of tool names so OpenClaw can generate manifest metadata (`contracts.tools`) without loading plugin runtime code. MCPGRAM's actual tools are the opposite of fixed β€” they're whatever connectors a given workspace happens to have connected, discovered live via `GET /api/v1/tools`.

Rather than force a static list onto a dynamic catalog, this plugin exposes a stable two-tool surface β€” list, then call by id β€” the same pattern OpenClaw's own [Tool Search](https://docs.openclaw.ai/tools/tool-search) feature uses for large or dynamic tool catalogs, instead of putting every schema in the prompt.

## Development

```bash
npm install
npm run build
openclaw plugins build --entry ./dist/index.js    # regenerates openclaw.plugin.json
openclaw plugins validate --entry ./dist/index.js
npm test
```

**Note on `openclaw.plugin.json` in this repo:** it's hand-authored to match the shape documented at [docs.openclaw.ai/plugins/tool-plugins](https://docs.openclaw.ai/plugins/tool-plugins), since generating it for real requires the `openclaw` CLI and package, which aren't available in the environment this was built in. Run `openclaw plugins build --entry ./dist/index.js` yourself after `npm install` to regenerate and verify it before publishing or installing β€” don't trust the committed version blindly.

## Error handling

- Auth/network errors (bad API key, unreachable `baseUrl`) throw and surface to the agent as a tool error.
- A tool that *ran* but failed (`status: "error"` from `/api/v1/execute`) also throws from `mcpgram_call_tool`, with the underlying error message, so the agent sees a clear failure rather than a silent empty result.

## Status

Calls the same `/api/v1/tools` and `/api/v1/execute` endpoints as `mcpgram-sdk` (JS) and `mcpgram-sdk-py` (Python). See those repos, or `mcpgram-dashboard`'s `app/api/v1/*`, for the server-side source of truth.
voice

Comments

Sign in to leave a comment

Loading comments...