Using the Model Context Protocol Server with Claude Desktop

A guide to integrating MCP-based tools with Claude and other AI assistants

What is MCP?

Model Context Protocol (MCP) allows Claude and other AI assistants to access external tools and data sources through specialized servers. This enables Claude to perform actions like retrieving financial data, converting files, or managing directories.

Setting Up MCP with Claude Desktop

Follow these steps to connect Claude Desktop to our MCP server. We offer two connection methods:

1. Install Claude Desktop

Download and install the Claude desktop application from claude.ai/download

2. Access Developer Settings

  1. Open Claude Desktop
  2. Click on the Claude menu in the top menu bar
  3. Select “Settings”
  4. Navigate to the “Developer” tab
  5. Click the “Edit Config” button

3. Configure the MCP Server

This will open your file browser to edit the claude_desktop_config.json file.

The simplest way to connect is using our HTTP over SSE endpoint. This method requires only your API token:

{
  "mcpServers": {
    "agentai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://mcp.agent.ai/YOUR_API_TOKEN_HERE/sse"
      ]
    }
  }
}

Replace YOUR_API_TOKEN_HERE with your actual API token from the agent.ai integrations page.

Benefits of HTTP over SSE:

  • Simple URL-based configuration
  • Automatic tool discovery
  • Works with all modern MCP clients
  • No additional environment variables needed

Method 2: Standard I/O (Legacy)

Alternatively, you can use the traditional stdio-based connection:

{
  "mcpServers": {
    "agentai": {
      "command": "npx",
      "args": [
        "-y",
        "@agentai/mcp-server"
      ],
      "env": {
        "API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

Replace YOUR_API_TOKEN_HERE with your actual API token.

Note: You can also set up multiple MCP servers, including the local filesystem server:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/accessible/directory1",
        "/path/to/accessible/directory2"
      ]
    },
    "agentai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://mcp.agent.ai/YOUR_API_TOKEN_HERE/sse"
      ]
    }
  }
}

4. Restart Claude Desktop

Save the configuration file and restart Claude Desktop for the changes to take effect.

Using MCP Tools with Claude

Once configured:

  1. Open a new conversation in Claude Desktop
  2. Look for the “Tools” icon in the main chat window
  3. Clicking this icon will display all available tools from your configured MCP servers
  4. You can directly ask Claude to use these tools in your conversation

For example, typing “Give me the latest company financial details about HubSpot” will prompt Claude to:

  • Identify the appropriate tool from available MCP servers
  • Request your permission to use the tool
  • Execute the request
  • Provide the results in a formatted response

Configuring Tool Access

You can control which agent.ai tools are exposed through MCP by visiting the integrations page and adjusting your Tool Selection Settings:

  • Action Tools: Core agent.ai action tools (recommended)
  • Team Agents: Agents shared within your team
  • Private Agents: Your personal custom agents
  • Top Public Agents: Highly-rated community agents (4.2+ stars, 3+ reviews)

MCP Server Package

Our MCP server is available as an NPM package at https://www.npmjs.com/package/@agentai/mcp-server. The package provides the necessary infrastructure to connect Claude and other AI assistants to our API services.

Security Considerations

  • Claude will always request your permission before running any MCP tool
  • You can grant permission for a single use or for the entire conversation
  • Review each action carefully before approving
  • Your API token is kept secure and is only used to authenticate with agent.ai services

Troubleshooting

If you encounter issues:

  1. Verify your API token is correct
  2. Ensure Claude Desktop has been restarted after configuration changes
  3. Check that the NPM packages can be installed (requires internet connection)
  4. Check that npx is available (bundled with Node.js; reinstall or run npm install -g npx if missing)
  5. Examine Claude’s error messages for specific issues

Common Issues:

  • “Connection refused” error: Make sure you’re using the correct URL format for your environment
  • “No tools available”: Check your Tool Selection Settings on the integrations page
  • “Authentication failed”: Verify your API token is correct and hasn’t expired

Using with Other MCP-Compatible Applications

This MCP server can be used with any application that supports the Model Context Protocol, not just Claude Desktop. The configuration process may vary by application, but the core functionality remains the same.

Testing Your MCP Server

You can test your agent.ai MCP server using the Cloudflare MCP Playground:

  1. Visit https://playground.ai.cloudflare.com/
  2. Enter your MCP server URL: https://mcp.agent.ai/YOUR_API_TOKEN_HERE/sse
  3. Click “Connect” to establish the connection
  4. The playground will automatically call the initialize method and list available tools
  5. You can then test individual tools by selecting them and providing input parameters

Note: The agent.ai MCP server supports multiple protocol versions (2024-11-05, 2025-03-26) for compatibility with different MCP clients. The server will automatically negotiate the appropriate version during initialization.

This is a great way to verify your MCP server is working correctly before configuring it in Claude Desktop or other MCP clients.

For additional help or to report issues, please contact our support team.