Using AgentNode as an MCP Server for Claude and Cursor
Expose AgentNode packages as MCP tools for Claude Desktop, Cursor, and any MCP-compatible client. Configure single packs or the full platform as an MCP server.
What Is MCP and Why Does It Matter?
The Model Context Protocol (MCP) is an open standard for connecting AI models to external tools and data sources. Instead of each AI application building its own tool integrations, MCP provides a universal interface: any tool exposed as an MCP server can be used by any MCP-compatible client.
MCP clients include Claude Desktop (Anthropic's desktop app), Cursor (the AI-powered code editor), and a growing number of AI applications. When you expose a tool as an MCP server, all of these clients can discover and use it without any client-specific integration code.
AgentNode provides two MCP server modes: you can expose a single installed package as an MCP tool server, or you can expose the entire AgentNode platform as an MCP server that lets the AI search, install, and use any package from the registry.
Prerequisites
- Node.js 18+ (the MCP server runs as a Node.js process)
- The AgentNode CLI installed:
npm install -g agentnode-cli - Python 3.10+ with the AgentNode SDK:
pip install agentnode-sdk - A supported MCP client (Claude Desktop, Cursor, or another MCP-compatible app)
Mode 1: Expose a Single Package as MCP Tools
The simplest approach is to expose one installed package as an MCP server. This gives the client access to all tools in that package.
Step 1: Install the Package
# Install the MCP adapter
pip install agentnode-mcp
# Install the package you want to expose
agentnode install pdf-reader-pack
Step 2: Start the MCP Server
agentnode-mcp --pack pdf-reader-pack
This starts an MCP server that exposes all tools from pdf-reader-pack. The server communicates over stdio by default, which is the standard transport for MCP. Each tool in the package becomes an MCP tool with its name, description, and input schema mapped directly from the AgentNode manifest.
Step 3: Configure Your MCP Client
Now you need to tell your MCP client about this server.
Claude Desktop Configuration
Claude Desktop reads MCP server configurations from a JSON file. On macOS, it's at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, it's at %APPDATA%\\Claude\\claude_desktop_config.json.
Add your AgentNode MCP server to the configuration:
{
"mcpServers": {
"pdf-reader": {
"command": "agentnode-mcp",
"args": ["--pack", "pdf-reader-pack"]
}
}
}
Restart Claude Desktop after editing the configuration. You should see the PDF reader tools appear in Claude's tool list. When you ask Claude to extract text from a PDF, it will use the AgentNode tool.
Cursor Configuration
Cursor supports MCP servers through its settings. Open Cursor's settings and navigate to the MCP configuration section, or edit the .cursor/mcp.json file in your project:
{
"mcpServers": {
"pdf-reader": {
"command": "agentnode-mcp",
"args": ["--pack", "pdf-reader-pack"]
}
}
}
After saving, Cursor will start the MCP server and make the tools available to the AI assistant when you work in that project.
Mode 2: Expose the Full AgentNode Platform
Instead of exposing a single package, you can expose the entire AgentNode platform as an MCP server. This gives the AI client the ability to search the registry, get package information, and use tools from any package:
agentnode-mcp-platform --api-url https://api.agentnode.net
This mode exposes higher-level tools to the AI client:
- search_packages — Search the AgentNode registry for packages matching a query
- get_package_info — Get detailed information about a specific package, including its verification score and tool list
- install_package — Install a package from the registry
- list_tools — List all tools available from installed packages
- run_tool — Execute a specific tool with given inputs
The Claude Desktop configuration for platform mode:
{
"mcpServers": {
"agentnode": {
"command": "agentnode-mcp-platform",
"args": ["--api-url", "https://api.agentnode.net"]
}
}
}
With this configuration, you can ask Claude something like "search AgentNode for a tool that converts Excel files to JSON, then use it on this spreadsheet." Claude will search the registry, find a suitable package, and use it—all through MCP.
Exposing Multiple Packages
You can run multiple MCP servers simultaneously, one per package. Each gets its own entry in the configuration:
{
"mcpServers": {
"pdf-tools": {
"command": "agentnode-mcp",
"args": ["--pack", "pdf-reader-pack"]
},
"csv-tools": {
"command": "agentnode-mcp",
"args": ["--pack", "csv-toolkit"]
},
"web-scraper": {
"command": "agentnode-mcp",
"args": ["--pack", "web-scraper-pack"]
}
}
}
Each server runs as a separate process. The AI client sees all tools from all servers and can use them together in a single conversation.
Practical Example: PDF Analysis in Claude Desktop
Let's walk through a complete example of using an AgentNode PDF reader with Claude Desktop.
1. Install the package and configure MCP:
# Terminal
agentnode install pdf-reader-pack
Add to claude_desktop_config.json:
{
"mcpServers": {
"pdf-reader": {
"command": "agentnode-mcp",
"args": ["--pack", "pdf-reader-pack"]
}
}
}
2. Restart Claude Desktop. You will see the tools icon indicating available MCP tools.
3. Use it in conversation. Send Claude a message like:
"Extract the text from the attached PDF and list all the section headings."
Claude will call the extract_text tool from your AgentNode package, get the PDF content, and respond with the section headings. The tool runs locally on your machine, so your documents never leave your computer.
Practical Example: Code Analysis in Cursor
In Cursor, you can use AgentNode tools to extend the AI assistant's capabilities for code-related tasks. For example, if you have a package that analyzes code complexity:
# .cursor/mcp.json
{
"mcpServers": {
"code-analysis": {
"command": "agentnode-mcp",
"args": ["--pack", "code-complexity-analyzer"]
}
}
}
Now when you ask Cursor's AI assistant to analyze the complexity of a file, it can use the AgentNode tool to provide quantitative metrics alongside its qualitative analysis.
How MCP Tool Discovery Works
When an MCP client starts, it connects to each configured MCP server and calls the tools/list method. The AgentNode MCP server responds with a list of tools, each containing:
- name — The tool's identifier, taken from the AgentNode manifest
- description — A natural-language description the AI uses to decide when to invoke the tool
- inputSchema — A JSON Schema describing the tool's expected parameters
When the AI decides to use a tool, it sends a tools/call request with the tool name and arguments. The AgentNode MCP server receives this, calls the underlying Python function via the AgentNode SDK, and returns the result.
This means the AI client never directly executes the tool's code. It communicates through the MCP protocol, and the AgentNode server handles execution, input validation, and error handling.
Security Considerations
When exposing AgentNode tools via MCP, keep these points in mind:
- Tools run locally. The MCP server executes tool code on your machine. This means tools have access to your local filesystem and network. Only install packages you trust.
- Check verification scores. Before exposing a package via MCP, check its verification tier. Packages with higher scores have been through more thorough testing in AgentNode's sandbox.
- Review permissions. Each AgentNode package declares its required permissions (network access, filesystem access, etc.). Check these with
agentnode info package-slugbefore exposing the tool. - Platform mode is powerful. The
agentnode-mcp-platformmode lets the AI install and run any package. Use this in development environments where you're comfortable with the AI having broad access to the registry.
Troubleshooting
Tools don't appear in Claude Desktop
Make sure the configuration file is valid JSON and the command path is correct. Run agentnode-mcp --pack your-package manually in a terminal to check for errors. Restart Claude Desktop completely after config changes.
Tool calls fail with timeout
Some tools take longer to execute than the MCP client's default timeout. For computationally intensive tools, this is expected. Check if the package documentation mentions expected execution times.
Python environment issues
The MCP server needs access to the Python environment where your AgentNode packages are installed. If you use virtual environments, make sure the agentnode-mcp command runs in the context of the correct environment.
Summary
AgentNode's MCP integration lets you expose verified agent skills to any MCP-compatible client. Use agentnode-mcp --pack package-slug to expose a single package, or agentnode-mcp-platform to expose the full registry. Configure your client (Claude Desktop, Cursor, or others) with a simple JSON entry pointing to the MCP server command. Tools are discovered automatically through the MCP protocol, and the AI can use them without any custom integration code on the client side.
LLM Runtime: Let the Model Handle It
If your agent uses OpenAI or Anthropic tool calling, AgentNodeRuntime handles tool registration, system prompt injection, and the tool loop automatically. The LLM discovers, installs, and runs AgentNode capabilities on its own — no hardcoded tool calls needed.
from openai import OpenAI
from agentnode_sdk import AgentNodeRuntime
runtime = AgentNodeRuntime()
result = runtime.run(
provider="openai",
client=OpenAI(),
model="gpt-4o",
messages=[{"role": "user", "content": "your task here"}],
)
print(result.content)
The Runtime registers 5 meta-tools (agentnode_capabilities, agentnode_search, agentnode_install, agentnode_run, agentnode_acquire) that let the LLM search the registry, install packages, and execute tools autonomously. Works with Anthropic too — just change provider="anthropic" and pass an Anthropic client.
See the LLM Runtime documentation for the full API reference, trust levels, and manual tool calling.