Tutorial: Publish Agents as MCP Tools
Expose your CrewForm agents as MCP (Model Context Protocol) tools that Claude Desktop, Cursor, and any MCP-compatible AI client can call directly. This turns your agents into universal AI building blocks.What You’ll Build
By the end of this tutorial, you’ll have:- A CrewForm agent published as an MCP tool
- Claude Desktop configured to call your agent
- A working end-to-end demo where Claude uses your agent as a tool
What is MCP?
The Model Context Protocol is an open standard for connecting AI systems with external tools and data sources. When you publish a CrewForm agent as an MCP server, any MCP-compatible client can discover and invoke it — just like calling a function.CrewForm is one of the few platforms that supports MCP as both client AND server. Your agents can consume external MCP tools and be consumed by other AI systems.
Prerequisites
- A CrewForm account with at least one configured agent
- Claude Desktop installed (or Cursor)
- An internet-accessible CrewForm instance (cloud or self-hosted with public URL)
Step 1: Create an Agent Worth Publishing
Let’s create a useful agent that Claude Desktop will call as a tool. Example: a code review agent.- Go to Agents → New Agent
- Configure:
| Field | Value |
|---|---|
| Name | Code Reviewer |
| Description | Reviews code for bugs, security issues, and best practices. Returns a structured report. |
| Model | claude-sonnet-4-20250514 |
| Temperature | 0.2 |
- System prompt:
- Click Create Agent
Step 2: Publish as MCP Tool
- Open your Code Reviewer agent
- Click the MCP Publish button in the header bar
- The button changes to MCP Published (green ✅)
What happens behind the scenes: The agent becomes available at your workspace’s MCP endpoint as a tool namedcode_reviewer(auto-derived from the agent name). The tool accepts amessagestring parameter and executes the full agent — same model, system prompt, tools, knowledge base, and voice profile as running from the UI.
Step 3: Generate an MCP API Key
- Go to Settings → MCP Servers
- Click Generate MCP API Key
- A key prefixed with
cf_mcp_will be generated - Copy the key — you’ll need it for the next step
Each key is scoped to a single workspace. Only that workspace’s published agents are visible to clients using that key.
Step 4: Configure Claude Desktop
- Open Claude Desktop → Settings → Developer → MCP Servers
- Add a new server with this configuration:
- Restart Claude Desktop
Self-hosted? Replace the URL with your task runner’s public URL: https://your-domain.com/mcp
Step 5: Test It
- Open a new conversation in Claude Desktop
- Ask Claude something like:
- Claude will recognize that it has a
code_reviewertool available and call your CrewForm agent - Your agent executes with its full configuration and returns the review
- Claude presents the result in the conversation
Step 6: Configure Cursor (Alternative)
If you prefer Cursor over Claude Desktop:- Create
.cursor/mcp.jsonin your project root:
- Restart Cursor — your CrewForm agents now appear as available tools
Publishing Multiple Agents
You can publish as many agents as you want from the same workspace:- Open each agent → click MCP Publish
- All published agents appear as separate tools under the same MCP server
- Tool names are auto-derived: “Data Analyst” →
data_analyst, “Bug Fixer” →bug_fixer
Unpublishing
To remove an agent from MCP:- Open the agent → click MCP Published (the green button)
- It toggles back to unpublished immediately
- The agent disappears from the MCP tool list
Advanced: Full Team Execution
When you publish an agent that belongs to a team, the MCP tool still executes just that individual agent. If you want to trigger a full pipeline or orchestrator team via MCP, create a dedicated “gateway” agent whose system prompt delegates to the appropriate team.Troubleshooting
| Issue | Solution |
|---|---|
| Claude doesn’t show the tool | Restart Claude Desktop after adding the config |
| ”Unauthorized” error | Check your cf_mcp_ key is correct and not expired |
| Tool call times out | Complex agents may take longer — consider increasing client timeout |
| Agent not in tool list | Make sure the agent is published (green MCP Published button) |
What’s Next?
- A2A Protocol — Let external agents discover and delegate tasks to your CrewForm agents
- AG-UI Protocol — Build rich, interactive agent UIs with streaming
- Knowledge Base — Give your published agents access to your documents

