# How to Set Up MCP Server Configurations for ECC: A Complete Guide

> Learn to set up MCP server configurations for ECC by creating a .mcp.json file. Define command or HTTP servers and manage API keys with .env for seamless integration.

- Repository: [Affaan Mustafa/ECC](https://github.com/affaan-m/ECC)
- Tags: how-to-guide
- Published: 2026-05-26

---

**Set up MCP server configurations for ECC by maintaining a [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) file in the repository root, where you define either `command`-based servers (launched via `npx`) or `type: "http"` endpoints, then supply any required API keys via the `.env` file.**

The ECC (Enterprise Code Collaboration) harness leverages the **Model Context Protocol (MCP)** to integrate live documentation, search, and automation tools directly into your AI workflow. All server definitions are centralized in a single JSON configuration file that the harness reads at startup. This guide walks through configuring, customizing, and securing MCP servers for the `affaan-m/ECC` repository.

## Understanding the MCP Configuration Structure

Every MCP server definition lives in [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) at the repository root—the same directory as [`README.md`](https://github.com/affaan-m/ECC/blob/main/README.md). When ECC starts, the harness parses this file to determine which servers to launch and how to route tool invocations from skills.

### Command-Based vs HTTP Server Types

The harness supports two distinct configuration patterns. **Command-based servers** specify an executable via the `command` and `args` fields. Typically, this executes `npx` to install and start an MCP package on-the-fly:

```json
{
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github@2025.4.8"]
}

```

**HTTP-based servers** declare `type: "http"` alongside a `url` field. The harness proxies MCP calls directly to this endpoint without spawning a local process:

```json
{
  "type": "http",
  "url": "https://mcp.exa.ai/mcp"
}

```

## Default MCP Servers in ECC

The repository ships with a production-ready [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) containing six pre-configured servers. These cover documentation resolution, AI search, persistent memory, browser automation, and structured reasoning:

```json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github@2025.4.8"]
    },
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@2.1.4"]
    },
    "exa": {
      "type": "http",
      "url": "https://mcp.exa.ai/mcp"
    },
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory@2026.1.26"]
    },
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp@0.0.69", "--extension"]
    },
    "sequential-thinking": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-sequential-thinking@2025.12.18"]
    }
  }
}

```

- **github**: Interfaces with GitHub repositories and issues.
- **context7**: Resolves library documentation IDs.
- **exa**: Provides AI search via HTTP endpoint.
- **memory**: Maintains persistent context across sessions.
- **playwright**: Controls browsers for end-to-end testing.
- **sequential-thinking**: Enables structured reasoning workflows.

## Customizing Your MCP Setup

You can add, remove, or modify servers by editing [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json). The harness automatically adopts changes on the next startup.

### Adding a Private HTTP Server

To integrate an internal documentation server at `http://docs.internal/mcp`, append a new entry:

```json
{
  "mcpServers": {
    "company-docs": {
      "type": "http",
      "url": "http://docs.internal/mcp"
    }
  }
}

```

### Pinning Specific Package Versions

Override the default Context7 version by updating the `args` array:

```json
{
  "context7": {
    "command": "npx",
    "args": ["-y", "@upstash/context7-mcp@2.2.0"]
  }
}

```

## Managing Credentials and Environment Variables

MCP servers requiring authentication receive credentials through environment variables. **Never commit secrets to [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json)**.

Instead, create a `.env` file in the repository root following the template in `.env.example`:

```bash
CONTEXT7_API_KEY=sk_test_abc123
GITHUB_TOKEN=ghp_xxxxxxxxxxxx

```

The harness loads these variables via `dotenv` at runtime and injects them into spawned server processes.

## Running ECC with MCP Servers

### Local Development Startup

Launch the ECC harness to automatically discover [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json):

```bash
npm install
npm run dev

```

During the first request to a server, the harness executes the `npx` command (visible in logs as `npx -y @modelcontextprotocol/server-github@2025.4.8`). The process remains alive for the session duration, with subsequent calls reusing the existing instance.

### Invoking MCP Tools from Skills

Skills interact with MCP servers using the namespaced format `mcp__{server-name}__{tool-name}`. For example, to resolve a library ID via Context7:

```python
library_id = await tool(
    "mcp__context7__resolve-library-id",
    {"library": "react", "version": "18"}
)

```

The harness routes this request to the `context7` server defined in [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) and returns the result to the skill.

## Summary

- **Centralized configuration**: All MCP server definitions reside in the repository-root [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) file, which the ECC harness reads at startup.
- **Dual launch modes**: Use `command` + `args` for `npx`-based local servers, or `type: "http"` for remote endpoints.
- **Pre-configured stack**: ECC ships with ready-to-use integrations for GitHub, Context7, Exa, Memory, Playwright, and Sequential Thinking.
- **Security best practice**: Store API keys in `.env`, never in the JSON configuration, to prevent credential leakage.
- **Automatic lifecycle management**: The harness spawns server processes on-demand and maintains them for the session duration.

## Frequently Asked Questions

### Where does ECC look for MCP server configurations?

The ECC harness searches for [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) exclusively in the repository root directory. This file serves as the single source of truth for all MCP server definitions, as implemented in `affaan-m/ECC`.

### How do I add a custom MCP server to ECC?

Edit [`.mcp.json`](https://github.com/affaan-m/ECC/blob/main/.mcp.json) to add a new entry under the `mcpServers` object. For Node.js-based servers, use the `command` field with `npx` arguments. For external APIs, use `type: "http"` and specify the target `url`. Commit the updated file to version control.

### Can I use private or self-hosted MCP servers with ECC?

Yes. Configure a `type: "http"` entry pointing to your internal endpoint, such as `http://docs.internal/mcp`. The harness proxies requests directly to this URL without launching a local process, making it suitable for private network resources.

### Where should I store API keys for MCP servers?

Store sensitive credentials in the `.env` file at the repository root, following the structure shown in `.env.example`. The harness automatically loads these variables and passes them to spawned MCP server processes, ensuring secrets remain outside of version control.