Skip to content

Add /mcp to run and configure the bundled MCP server - #23

Merged
barkz merged 2 commits into
mainfrom
feat/mcp-command
Aug 20, 2026
Merged

Add /mcp to run and configure the bundled MCP server#23
barkz merged 2 commits into
mainfrom
feat/mcp-command

Conversation

@barkz

Copy link
Copy Markdown
Owner

Adds /mcp — inspect, configure, and run the bundled MCP server without leaving the REPL.

This work has been sitting on feat/mcp-command unmerged. It is being landed on its own so the flow-mapper branch reviews as one feature rather than two.

What it does

Command
/mcp statusInstalled mcp version, whether it can actually run the server, and any running instance's pid, URL, uptime, and mode
/mcp config [client]Paste-ready JSON for Claude Code, Claude Desktop, or Cursor
/mcp startRuns the server detached over HTTP
/mcp stopTerminates it

Two decisions worth knowing

start deliberately refuses stdio. stdio is a pipe pair between a client and the server it spawned — started from the REPL there would be no client on the other end, and the REPL already owns its own stdin and stdout. start therefore runs streamable-http (default) or sse, which a client attaches to by URL. Transport flags were added to glean_mcp.py to support this.

--name exists because of a silent collision. Glean ships its own hosted MCP server, and both would naturally register under the key glean. Pasting one over the other replaces it with no error — you simply end up with a different toolset than you expected. /mcp config --name glean-cli keeps both, and the default form warns when it emits the colliding name.

Notes

  • Binds 127.0.0.1 by default — a live server holds whatever credentials your config has
  • The server outlives the REPL; state lives in ~/.gleancode/mcp.json and stale entries clear themselves
  • mcp_control.py never imports the mcp package, so the REPL stays dependency-free
  • 285 lines of tests in tests/test_mcp_control.py
  • Docs: docs/MCP.md and docs/COMMANDS.md

🤖 Generated with Claude Code

@barkz
barkz merged commit d208626 into mainAug 20, 2026
7 checks passed
@barkz
barkz deleted the feat/mcp-command branch August 20, 2026 03:19
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@barkz