# Adding and Managing MCP Servers

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Via Configuration File</strong></td><td>The primary method involves editing the MCP configuration file, typically named mcp.json. This approach offers precise control and is ideal for developers comfortable with JSON editing.</td></tr><tr><td><strong>Via Add Sever PureCode UI</strong></td><td>For users preferring a guided approach, the PureCode UI provides forms to add servers without directly editing JSON files.</td></tr></tbody></table>

### Server Management Dashboard

<figure><img src="/files/wYONrTvqYqxwpOKrjUOW" alt=""><figcaption></figcaption></figure>

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Status Meeting</strong></td><td>Real-time connection status: connected, error, or loading</td></tr><tr><td><strong>Tool Discovery</strong></td><td>Browse all available tools exposed by each MCP server</td></tr><tr><td><strong>Configuration</strong></td><td>Edit, enable/disable, or remove server configurations</td></tr></tbody></table>

{% hint style="info" %}
**Restart Required**

After making configuration changes, restart the extension or reload its configuration for changes to take effect. This ensures proper synchronization with MCP servers.
{% endhint %}

### MCP Server Configurations

{% tabs fullWidth="true" %}
{% tab title="GitHub Integration" %}
{% code title="Connect to Github's API using the official GitHub MCP server running in Docker" fullWidth="true" %}

```json
{
  "mcpServers": {
    "github": {
      "name": "GitHub Integration",
      "id": "github",
      "transport": {
        "type": "stdio",
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "GITHUB_PERSONAL_ACCESS_TOKEN",
          "ghcr.io/github/github-mcp-server"
        ],
        "env": {
          "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"
        }
      },
      "enabled": true
    }
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Custom API Integration" %}
{% code title="Connect to any custom or third-party API by wrapping it in an MCP server." overflow="wrap" fullWidth="true" %}

```json
{
  "mcpServers": {
    "searchapi": {
      "name": "Search API",
      "id": "searchapi",
      "transport": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "search1api-mcp"],
        "env": {
          "SEARCH1API_KEY": "your_api_key_here"
        }
      },
      "enabled": true
    }
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Filesystem Indexing" %}
{% code title="Access local project files and directories using the @modelcontextprotocol/server-filesystem package." %}

```json
{
  "mcpServers": {
    "file-system": {
      "name": "Local Filesystem Access",
      "id": "file-system",
      "transport": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/projects"]
      },
      "enabled": true
    }
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Remote HTTP Services" %}
{% code title="Connect to MCP servers running as remote HTTP services using Server-Sent Events." fullWidth="true" %}

```json5
{
  "mcpServers": {
    "remote-service": {
      "name": "Remote MCP Service",
      "id": "remote-service",
      "transport": {
        "type": "sse",
        "url": "https://api.example.com/mcp-events"
      },
      "enabled": true
    }
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### User Experience with MCP-Enabled Tools

<table data-card-size="large" data-view="cards" data-full-width="true"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Tool Discovery</strong></td><td>Once connected, MCP server tools automatically appear in the PureCode sidebar, organized by server. Each tool shows its human-readable name and current status.</td></tr><tr><td><strong>Detailed Information</strong></td><td>Expand any tool call to view comprehensive details including the tool name, arguments passed, execution status, and complete results or error messages.</td></tr><tr><td><strong>Real-time Feedback</strong></td><td>During tool execution, users see live status indicators, progress updates, and immediate results. The interface provides clear visual cues for active operations.</td></tr><tr><td><strong>Error Handling</strong></td><td>Clear error messages and partial results are displayed when tool calls encounter issues, allowing for quick troubleshooting and recovery.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://purecodedocs.gitbook.io/docs/features/model-context-protocol-mcp/adding-and-managing-mcp-servers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
