Connect your agent
Install the ctxpipe MCP in Claude Code, Cursor, Codex, OpenCode, or VS Code, with the CLI or by hand.
ctxpipe has one remote MCP server for every organization:
https://app.ctxpipe.ai/mcpA self-hosted deployment uses the same /mcp path on its own origin. The
server uses Streamable HTTP. It gives your agent
seven read-only tools.
Install with the CLI
Run this in a repository:
npx ctxpipe initThe wizard signs you in, asks which organization and agent clients to configure, and shows the planned file changes before it writes them. Write the configuration to the repository, to your user profile, or to both. To share the setup with your team, commit the repository configuration that the CLI writes. It holds no secret.
The wizard can also set up local memory. To configure
the MCP only, run npx ctxpipe mcp add.
| Client | Repository configuration | User configuration |
|---|---|---|
| Claude Code | .mcp.json | Runs claude mcp add when the Claude CLI is installed. Without the Claude CLI, the CLI writes the repository .mcp.json, or prints the command for an API key. |
| Cursor | .cursor/mcp.json | ~/.cursor/mcp.json |
| Codex | No repository file. Prints a codex mcp add command, which writes your user configuration. For an API key, it prints the .codex/config.toml lines. | Runs codex mcp add when the Codex CLI is installed. Without the Codex CLI, the CLI prints the command. For an API key, it prints the config.toml lines. |
| OpenCode | opencode.json | ~/.config/opencode/opencode.json |
| VS Code / Copilot | .vscode/mcp.json | Prints a VS Code install link |
The CLI sign-in is only for setup. The CLI keeps it in the OS keychain, or in
~/.config/ctxpipe/ when no keychain is available. Your agent client asks you
to authorize ctxpipe separately the first time it connects.
Scripts and CI
Use flags to run the CLI without prompts:
npx ctxpipe init --org acme --agents cursor,claude --scope repo --non-interactive
npx ctxpipe mcp add --client opencode --scope user --non-interactive
npx ctxpipe doctor --jsonRun npx ctxpipe init --help for all flags. Examples are --base-url,
--dry-run, --json, --no-mcp, and --auth api-key. For an agent that
cannot sign in through a browser, see API keys.
Authorize the client
The first time your client connects, it opens ctxpipe in the browser:
- Sign in to ctxpipe.
- Select the organizations that the client can read. The organization of your current session is selected. Select at least one.
- Leave Also allow changes clear. It shows only when a client asks for write access, and the MCP tools never need it.
- Approve. The client returns to your agent, ready to use.
Each tool call names one of the organizations that you selected. To change the set later, or to revoke the client, open Connected apps.
Configure a client by hand
Use manual configuration when the CLI does not support your client, or when another tool manages the configuration. The client opens the browser to authorize, so the configuration holds no token.
Claude Code
.mcp.json in the repository:
{
"mcpServers": {
"ctxpipe": {
"type": "http",
"url": "https://app.ctxpipe.ai/mcp"
}
}
}For your user profile, run
claude mcp add --transport http ctxpipe --scope user https://app.ctxpipe.ai/mcp.
Cursor
.cursor/mcp.json in the repository, or ~/.cursor/mcp.json:
{
"mcpServers": {
"ctxpipe": {
"type": "http",
"url": "https://app.ctxpipe.ai/mcp"
}
}
}Codex
codex mcp add ctxpipe --url "https://app.ctxpipe.ai/mcp"OpenCode
opencode.json in the repository, or ~/.config/opencode/opencode.json:
{
"mcp": {
"ctxpipe": {
"type": "remote",
"url": "https://app.ctxpipe.ai/mcp",
"enabled": true
}
}
}VS Code / Copilot
.vscode/mcp.json in the repository:
{
"servers": {
"ctxpipe": {
"type": "http",
"url": "https://app.ctxpipe.ai/mcp"
}
}
}For your user profile, use the install link that
npx ctxpipe mcp add --client vscode --scope user prints.
Other clients
Use the endpoint URL with the Streamable HTTP transport. The name of the transport key changes between clients. Read the documentation of your client.
Check the connection
Ask your agent:
Call the ctxpipe list_workspaces tool, then search_knowledge for our
standards on authentication.A finished browser sign-in does not prove tool access. The tools must return your Workspaces.
Troubleshooting
- The client asks for authorization after the CLI signed you in. This is correct. The CLI sign-in and the client authorization are separate.
- The connection fails with only a URL. Add the
typefield for your client. Most clients do not detect the transport. - Cursor or Claude Code refuses the server type. Use
"type": "http". - OpenCode shows the server, but it does not connect. Use the top-level
mcp.ctxpipeshape withtype: "remote"andenabled: true. - The client cannot finish the browser sign-in. Use an API key.
- A tool returns
org_not_found. See Connected apps.
Old configurations can have ?orgSlug= in the URL. The server ignores it, so
you can keep it or remove it. The current CLI writes the URL without it.
Related
- Use ctxpipe from your agent: the tools and how to use them
- API keys: CI, review bots, and headless agents
- Connected apps: change organizations or revoke a client
- Local memory: Markdown memory that agents keep in the repository