> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fliiq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Integration

> Connect external tools via Model Context Protocol

Fliiq supports the [Model Context Protocol](https://modelcontextprotocol.io) (MCP), letting you connect external tool servers alongside built-in skills. Any MCP-compatible server works — GitHub, databases, custom APIs, and more.

## Adding a Server

### Stdio transport (local process)

```bash theme={null}
fliiq mcp add github --command npx --args "@modelcontextprotocol/server-github"
```

### Streamable HTTP transport (remote server)

```bash theme={null}
fliiq mcp add my-api --url https://mcp.example.com/mcp
```

## Managing Servers

```bash theme={null}
fliiq mcp list              # Show configured servers
fliiq mcp test              # Validate all connections
fliiq mcp test github       # Test a specific server
fliiq mcp remove github     # Remove a server
```

## How It Works

1. On startup, Fliiq connects to each configured MCP server
2. Discovers available tools from each server
3. Registers them alongside built-in skills
4. Tools are prefixed as `mcp_{server}_{tool}` (e.g., `mcp_github_create_issue`)

The agent sees MCP tools as regular tools — no special handling needed. It picks the right tool based on the task.

**Connection failures are non-fatal.** If one MCP server is down, all other servers and built-in skills continue working normally.

## Configuration File

Servers are stored in `.fliiq/mcp.json` (created by `fliiq init --project`). You can edit it directly:

```json theme={null}
{
  "servers": {
    "github": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-github"],
      "transport": "stdio"
    },
    "my-api": {
      "url": "https://mcp.example.com/mcp",
      "transport": "streamable-http"
    }
  }
}
```

## Environment Variables

Some MCP servers require API keys. Set them in `~/.fliiq/.env`:

```bash .env theme={null}
GITHUB_TOKEN=ghp_...
```

The server process inherits environment variables from Fliiq's environment.
