t3-mcp-hub
by mainali123
README.md
# t3-mcp-hub
**One MCP endpoint for every coding agent on your machine.** Add an MCP server once, in any agent or with one command, and Claude Code, Codex, OpenCode, Copilot, Cursor, Gemini, Antigravity, Mistral Vibe, Kiro, Junie and GLM Agent can all use it. That includes those agents running inside [T3 Code](https://t3.codes).
```
┌──────────── claude mcp add … / codex config.toml / opencode.json … ───────────┐
│ (add a server anywhere: the hub moves it into its list) │
▼ │
~/.config/t3-mcp/servers.json ──▶ t3-mcp-hub (http://127.0.0.1:47900/mcp) │
│ ├── atlassian (26 tools) │
│ ├── playwright (25 tools) │
│ └── … │
▼ │
Claude · Codex · OpenCode · Copilot · Cursor · Gemini · Kiro · Junie ── each has one ──────┘
entry: "t3-hub"
```
## Why
Every agent keeps its own MCP config in its own format: JSON, TOML, `claude mcp`, and others. Adding a server means doing it six times, and sign-ins and settings drift apart. t3-mcp-hub runs a single local MCP server that connects to all your servers and offers all their tools at one address. Each agent gets one entry pointing at it.
- **Add anywhere.** If you add a server the usual way in any agent (`claude mcp add …`, editing `~/.codex/config.toml`, OpenCode's config…), the hub notices within about 3 seconds. It moves the server into its own list and removes that agent's direct entry, so every agent gets it once, through the hub.
- **Or add it centrally** with `t3-mcp add`.
- **No restarts.** The hub reloads its list by itself and tells connected agents their tools changed.
- **Sign-ins handled.** Remote servers that need a browser sign-in go through [`mcp-remote`](https://www.npmjs.com/package/mcp-remote), which saves the sign-in in `~/.mcp-auth`. Each sign-in happens once and is shared by every agent.
- **No clashes.** Tools are renamed `<server>__<tool>` (for example `atlassian__getJiraIssue`), so two servers can't collide. A `hub__status` tool shows which servers are up.
- **Starts on login.** The hub runs as a background systemd user service, and restarts if it crashes.
## Requirements
| Requirement | Notes |
|---|---|
| **Linux with systemd user services** | Tested on Arch Linux. On macOS, run the hub by hand (see [Without systemd](#without-systemd)). |
| **Python 3.10+** | The installer creates a private environment with `mcp` (1.x), `uvicorn` and `starlette`. `uv` is used if you have it. |
| **Node.js / `npx`** | Needed for remote servers that sign in through `mcp-remote` and for npx-based servers like Playwright. nvm, fnm and mise installs are detected. |
| **At least one supported agent** | See [Supported agents](#supported-agents). |
## Install
```bash
git clone https://github.com/mainali123/t3-mcp-hub.git
cd t3-mcp-hub
./install.sh
```
The installer:
1. Installs the hub to `~/.local/share/t3-mcp-hub` and the `t3-mcp` command to `~/.local/bin`.
2. Starts the background service `t3-mcp-hub` on `127.0.0.1:47900`.
3. **Moves the MCP servers your agents already have into the hub**, removing their direct entries so nothing shows up twice.
4. **Links every installed agent** by adding a `t3-hub` entry that points at the hub.
Then restart running agents, or start new threads in T3 Code, and check:
```bash
t3-mcp status # each server, its state and tool count
t3-mcp doctor # checks the whole setup
```
Every agent config file is backed up to `~/.config/t3-mcp/backups/` before it's changed. Running `./install.sh` again updates an existing install.
### Options
Set these before running `./install.sh`:
| Variable | Default | What it does |
|---|---|---|
| `T3_MCP_PORT` | `47900` | Port the hub listens on (localhost only) |
| `T3_MCP_ABSORB` | `move` | `move`: take servers out of agents into the hub. `copy`: copy them into the hub but leave the agents' own entries. `off`: never touch agents' servers |
| `T3_MCP_HOME` | `~/.local/share/t3-mcp-hub` | Install folder |
## Usage
```bash
# Remote server that needs a browser sign-in (OAuth), handled by mcp-remote
t3-mcp add github --url https://api.githubcopilot.com/mcp/
t3-mcp login github # once, if `t3-mcp status` shows a sign-in error
# Remote server with a fixed token
t3-mcp add myapi --url https://example.com/mcp --header "Authorization=Bearer ${MY_TOKEN}"
# Local server started as a command
t3-mcp add fetch -- uvx mcp-server-fetch
t3-mcp add fs --env ROOT=/home/me/notes -- npx -y @modelcontextprotocol/server-filesystem /home/me/notes
t3-mcp list | status | doctor
t3-mcp disable NAME | enable NAME | remove NAME
t3-mcp edit # open servers.json in $EDITOR
t3-mcp agents # which agents are installed and linked
t3-mcp link [AGENT…] | unlink [AGENT…]
t3-mcp absorb [--copy] # pull servers from agents into the hub right now
t3-mcp logs [NAME] # follow the hub log, or one server's log
```
Or just add servers the way you already do:
```bash
claude mcp add -s user fetch -- uvx mcp-server-fetch # moved into the hub within ~3 seconds
```
### servers.json
Your server list is at `~/.config/t3-mcp/servers.json`, readable only by you. It uses the same `mcpServers` format as Claude, Cursor and others:
```json
{
"mcpServers": {
"playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] },
"atlassian": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.atlassian.com/v2/mcp"] },
"myapi": { "url": "https://example.com/mcp", "headers": { "Authorization": "Bearer ${MY_TOKEN}" } },
"old-thing": { "command": "node", "args": ["server.js"], "enabled": false }
}
}
```
Each server can also have:
| Key | What it does |
|---|---|
| `env` | Environment variables for a command-based server |
| `cwd` | Folder to start a command-based server in |
| `transport: "sse"` | Use SSE instead of streamable HTTP for a `url` server |
| `includeTools` / `excludeTools` | Lists of tool names to show or hide |
| `timeout` | Seconds to wait for one tool call (default 600) |
| `startupTimeout` | Seconds to wait for the server to start (default 120) |
`${VAR}` in any value is replaced with that environment variable, so tokens can stay out of the file.
## Supported agents
| Agent | Config the hub links and watches |
|---|---|
| Claude Code | user scope in `~/.claude.json`, changed through the `claude mcp` command |
| Codex | `~/.codex/config.toml` |
| OpenCode | `~/.config/opencode/opencode.json` |
| GitHub Copilot CLI | `~/.copilot/mcp-config.json` |
| Cursor (agent/IDE) | `~/.cursor/mcp.json` |
| Gemini CLI | `~/.gemini/settings.json` |
| Kiro | `~/.kiro/settings/mcp.json` |
| Junie | `~/.junie/mcp/mcp.json` |
| Antigravity | `~/.gemini/config/mcp_config.json` (symlinks are kept), plus each T3 Code Antigravity profile in `~/.t3/userdata/providers/antigravity/*/config/` |
| Mistral Vibe | `[[mcp_servers]]` in `~/.vibe/config.toml` |
| GLM Agent (in T3 Code) | No config file of its own. `t3-mcp link` sets its T3 Code `commandPath` to `~/.local/bin/t3-hub-acp-glm`, a wrapper that adds `t3-hub` to every ACP session |
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
**T3 Code** runs these same agents, so every T3 Code thread gets the hub by default. Any other ACP agent without a config file can be wrapped the same way: `acp_inject.py --agent REGISTRY_ID` or `acp_inject.py --exec PROGRAM -- ARGS` adds `t3-hub` to the MCP servers the client sends.
Only user-level (global) configs are watched. Servers you add to a single project, such as Claude's project scope or a project's `.mcp.json`, stay in that project.
## Uninstall
```bash
./uninstall.sh
```
The uninstaller first **copies every hub server back into each agent's own config**, so nothing stops working. Then it removes the `t3-hub` entries and the service. Your `servers.json` and the backups are kept. Run `./uninstall.sh --no-restore` to skip copying servers back.
## Without systemd
```bash
~/.local/share/t3-mcp-hub/.venv/bin/python ~/.local/share/t3-mcp-hub/hub.py &
```
Then run `t3-mcp link`. Start the hub whichever way suits your system (launchd, a login item, tmux…).
## Troubleshooting
- **`t3-mcp doctor`** checks the service, each server, and each agent's link.
- **A server shows `error`:** run `t3-mcp logs NAME`. For sign-in servers, run `t3-mcp login NAME`.
- **An agent doesn't see new tools:** restart that agent or T3 Code thread once after linking. After that, new servers show up without restarts, as long as the agent handles MCP tool-list updates (most do).
- **A server can't find `npx` or other commands:** the service uses the PATH your shell had when you ran `install.sh`. Run `./install.sh` again after installing new tools.
- **To undo one change:** every agent config the hub touched has timestamped copies in `~/.config/t3-mcp/backups/`.
## Limitations
- **Tools only.** MCP resources and prompts from your servers aren't passed through yet.
- **One sign-in per server.** All agents share it, so you can't use different accounts for the same server in different agents.
- **Localhost only.** The hub listens on `127.0.0.1` and has no login of its own, so anything running as your user on this machine can call its tools.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues