Skip to content

docs: MCP server configuration guide#1138

Open
arc-claw-bot wants to merge 1 commit intonearai:stagingfrom
arc-claw-bot:docs/mcp-server-guide
Open

docs: MCP server configuration guide#1138
arc-claw-bot wants to merge 1 commit intonearai:stagingfrom
arc-claw-bot:docs/mcp-server-guide

Conversation

@arc-claw-bot
Copy link

Adds docs/MCP_SERVERS.md — a practical guide for configuring MCP servers with IronClaw.

Written against the current implementation (src/tools/mcp/, src/cli/mcp.rs) as of March 2026, covering:

  • Three transports: HTTP (with OAuth 2.1/PKCE), stdio, and Unix socket
  • CLI commands: mcp add, test, list, remove, auth
  • Config file format: ~/.ironclaw/mcp-servers.json structure with transport-specific fields
  • Custom headers for API-key-based auth
  • Example servers (filesystem, postgres, fulcra-context-mcp)
  • Troubleshooting section with debug logging

This replaces #777 which was rightfully closed as stale. Rewrote from scratch based on the actual Rust source (McpServerConfig, McpTransportConfig, OAuthConfig structs, CLI arg definitions).

Documentation only — no code changes.

Covers the three transport types (HTTP, stdio, Unix), OAuth 2.1
authentication, environment variables for stdio servers, custom
headers, the mcp-servers.json config format, example servers,
and troubleshooting.

Written against the current implementation in src/tools/mcp/ and
src/cli/mcp.rs.
@github-actions github-actions bot added scope: docs Documentation size: XS < 10 changed lines (excluding docs) risk: low Changes to docs, tests, or low-risk modules contributor: new First-time contributor labels Mar 13, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new, comprehensive documentation guide for configuring Model Context Protocol (MCP) servers within IronClaw. The guide aims to empower users to seamlessly integrate external tools and data sources by detailing various transport mechanisms, CLI commands for server management, configuration file specifics, and authentication methods like OAuth 2.1/PKCE and custom headers. It also provides practical examples and troubleshooting tips to ensure a smooth user experience.

Highlights

  • New MCP Server Configuration Guide: A new documentation file, docs/MCP_SERVERS.md, has been added to provide a practical guide for configuring Model Context Protocol (MCP) servers with IronClaw.
  • Comprehensive Transport Coverage: The guide covers three primary transport methods: HTTP (including OAuth 2.1/PKCE), stdio, and Unix sockets, detailing their use cases and configuration.
  • CLI Command Usage: Detailed instructions are provided for using ironclaw mcp CLI commands such as add, test, list, remove, and auth for server management.
  • Configuration File and Custom Headers: The documentation explains the structure of the ~/.ironclaw/mcp-servers.json configuration file and how to use custom headers for API-key-based authentication.
  • Examples and Troubleshooting: The guide includes examples of community MCP servers and a dedicated troubleshooting section with tips for checking server health, re-authenticating, and debug logging.
Changelog
  • docs/MCP_SERVERS.md
    • Added a new guide for configuring MCP servers, detailing transports, CLI commands, configuration, and troubleshooting.
Activity
  • The pull request introduces new documentation, replacing a previously stale PR (docs: add MCP server examples guide #777).
  • The documentation was rewritten from scratch based on the current Rust source code for MCP server configuration.
  • This PR is documentation-only, with no code changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new documentation file, docs/MCP_SERVERS.md, which serves as a guide for configuring MCP servers. The documentation is comprehensive, covering various transports, CLI commands, and troubleshooting steps. My review identified a critical error in the example mcp-servers.json configuration file structure, as well as an opportunity to improve the troubleshooting section by documenting a relevant CLI command instead of suggesting manual file edits. I have provided specific suggestions to address these points.

Comment on lines +72 to +96
{
"servers": {
"filesystem": {
"name": "filesystem",
"url": "",
"transport": {
"transport": "stdio",
"command": "npx",
"args": ["@anthropic/mcp-filesystem", "/home/user/documents"],
"env": {}
},
"enabled": true,
"description": "Sandboxed file access"
},
"notion": {
"name": "notion",
"url": "https://mcp.notion.com",
"oauth": {
"client_id": "your-client-id",
"scopes": ["read", "write"]
},
"enabled": true
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The JSON structure for mcp-servers.json is incorrect. The servers field should be a JSON array of server configuration objects, not an object mapping server names to configurations. This can be seen from the McpServersFile struct definition in src/tools/mcp/config.rs, where servers is a Vec<McpServerConfig>. Manually editing the file with the documented structure will lead to parsing errors.

{
  "servers": [
    {
      "name": "filesystem",
      "url": "",
      "transport": {
        "transport": "stdio",
        "command": "npx",
        "args": ["@anthropic/mcp-filesystem", "/home/user/documents"],
        "env": {}
      },
      "enabled": true,
      "description": "Sandboxed file access"
    },
    {
      "name": "notion",
      "url": "https://mcp.notion.com",
      "oauth": {
        "client_id": "your-client-id",
        "scopes": ["read", "write"]
      },
      "enabled": true
    }
  ]
}

ironclaw mcp auth <server-name>

# Disable without removing
# Edit ~/.ironclaw/mcp-servers.json, set "enabled": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The documentation suggests manually editing the configuration file to disable a server. While this works, there is a dedicated CLI command ironclaw mcp toggle for this purpose which is safer and more user-friendly. You should document this command instead. You can use --disable or --enable flags, or just toggle to flip the state.

Suggested change
# Edit ~/.ironclaw/mcp-servers.json, set "enabled": false
ironclaw mcp toggle --disable <server-name>

Copy link
Collaborator

@henrypark133 henrypark133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: useful guide, but the config-file example is not the format IronClaw actually reads

The guide is directionally good and covers the right concepts, but there is one blocking correctness issue before I’d merge it.

Critical: mcp-servers.json is documented with the wrong top-level structure

The example shows:

  • servers as an object keyed by server name

But McpServersFile currently stores:

  • servers as a list of McpServerConfig
  • schema_version as a top-level field

Right now a reader who copies the example will produce a config file that does not match the real serde shape.

Minor: the troubleshooting section should use the existing toggle command

For “disable without removing”, the docs currently tell users to edit the JSON file manually. The CLI already has ironclaw mcp toggle <name> --disable, which is a better first recommendation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: new First-time contributor risk: low Changes to docs, tests, or low-risk modules scope: docs Documentation size: XS < 10 changed lines (excluding docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants