MCP Server Plugin Documentation
The MCP (Model Context Protocol) Server Plugin is provided through the C3 Package mcpServer, and includes C3 Types, Seed Data, Metadata, and dependent packages. This package enables developers to quickly enable their applications as an MCP server.
Dependencies
| Dependent Package | Purpose of this Package |
|---|---|
| genaiPlatform | Provides basic APIs to manage tools |
Key C3 AI Types in this package
| C3 AI Type | Description |
|---|---|
| Mcp.Server | Restful type that serves as the MCP endpoint |
| Mcp.Engine | Engine type that handles tool calls |
Key files in this package
The package is structured in the following manner:
mcpServer/
└── src/
├── mcp/
│ └── toolEngine/
├── prompt/
├── tools/
└── ui/| Folder name | Content |
|---|---|
| src/mcp/ | all types/impl for serving MCP endpoint |
| src/mcp/toolEngine | all types/impl for tool call engine |
| src/prompt | all types/impl for MCP prompt |
| src/tools | all types/impl for MCP tool management |
| src/ui | all types/impl for MCP UI |
Package-level changelogs
C3 MCP Server — Quick Start
Goal: run your app as an MCP server and connect to it from VS Code or Cursor.
1) Start your app as an MCP server
Prerequisites
- Your app declares a dependency on the
mcpServerpackage. - Your app is running (the MCP endpoints are served by your running app).
- It’s strongly recommended your app exposes at least one tool so the MCP server does something useful.
- Example:
# Create your own tool
test_type = c3.GenaiCore.Tool.C3Method.TestType
c3_add_tool = c3.GenaiCore.Tool.C3Method.createFromMethodName(test_type, "add")
# For this tool we need to ensure the flag `enabledInMcpServer` is set to True
# and upsert the tool into your application
c3_add_tool.withEnabledInMcpServer(True).upsert()Base endpoints
Your app should expose MCP under these paths (replace placeholders with real values):
- MCP root:
https://<cluster-name>/<env>/<app>/mcp - VS Code installer:
https://<cluster-name>/<env>/<app>/mcp/vscode - Cursor installer:
https://<cluster-name>/<env>/<app>/mcp/cursor - JSON config (for project-scoped setup):
https://<cluster-name>/<env>/<app>/mcp/json - MCP server endpoint:
https://<cluster-name>/<env>/<app>/mcp/server
Tip: You’ll need an auth cookie when using the JSON config. The header looks like:
{
"url": "https://<cluster-name>/<env>/<app>/mcp/server",
"headers": {
"Authorization": "c3Bearer <TOKEN>"
}
}2) Connect from your IDE
You can connect from VS Code or Cursor. The installer links above will auto-fill most fields for you.
A) VS Code
Open: https://<cluster-name>/<env>/<app>/mcp/vscode
VS Code 1.102.2 and earlier
- A prompt appears to install the MCP server (named
C3 Server - <env>/<app>by default). - Click Install to complete setup (installed globally).
- A prompt appears to install the MCP server (named
VS Code 1.102.3 and later
- An install page opens inside VS Code.
- Click Install.
- After installation you can find the entry at:
Code/User/mcp.json, or- via command palette: “MCP: Open User Configuration.”
Project-scoped setup (optional)
If you prefer per-repo settings rather than global:
- Open:
https://<cluster-name>/<env>/<app>/mcp/json - Copy the returned JSON (includes the
urland requiredCookieheader). - Save it as
{project-root}/.vscode/mcp.json.
This keeps the server config local to the repository and avoids modifying your global user config.
B) Cursor
Open: https://<cluster-name>/<env>/<app>/mcp/cursor
- Allow the browser to open Cursor.
- Cursor shows an install screen with the server URL/name prefilled.
- Click Install. The server will appear in Cursor’s MCP settings.
Note: Use a recent Cursor build (1.2.1+ recommended) for the smoothest install flow.
3) Verify the connection & use tools
VS Code
- Open Copilot Chat.
- Go to the Tools tab and pick one of your app’s tools.
- When prompted, click Continue/Allow to grant the tool permission.
- Run a quick command and confirm you see a successful result.
Cursor
- Open a chat.
- When a tool is invoked, click Accept/Allow.
- Confirm the tool returns results without errors.
If your app exposes no tools, the MCP connection works but there’s nothing useful to invoke. Expose at least one tool to test end-to-end.
4) Troubleshooting
Installer page stuck (VS Code):
Close and reopen VS Code, then revisit the installer URL for your version.401/403 errors when using project-scoped JSON:
Ensure theAuthorizationheader is present and contains a validc3Bearertoken for the target environment.Server not found / 404:
Confirm your app is running and the base path responds athttps://<cluster-name>/<env>/<app>/mcp.Nothing shows in Tools:
Double-check your app actually registers tools with the MCP server.Per-repo config not taking effect (VS Code):
Make sure the file path is exactly{project-root}/.vscode/mcp.jsonand your workspace is opened at the project root.
5) Quick checklist
- Add dependency:
mcpServeris included in your app. - Run your app: MCP is served at
/mcp. - Install in IDE:
- VS Code: visit
/mcp/vscode(or use/mcp/json→.vscode/mcp.json). - Cursor: visit
/mcp/cursor.
- VS Code: visit
- Approve tools: Allow tool usage when prompted.
- Smoke test: Call one tool and verify a successful response.