Start Your Local CodeMCP Server
Before connecting any AI assistant, launch CodeMCP in your target project directory. It will start the local Model Context Protocol server and output your connection credentials.
http://localhost:4173/mcp (For Desktop LLMs & IDEs)https://<your-tunnel-subdomain>.ngrok-free.app/mcp (For Browser AI)<auto-generated-session-token> (Vault protected)Connect Desktop AI Clients
Connect native desktop apps and code editors running locally on your machine via stdio or localhost SSE.
Claude Desktop Configuration
Claude Desktop supports standard Model Context Protocol servers over stdio.
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"codemcp-project": {
"command": "npx",
"args": ["-y", "@mahesh2-lab/codemcp", "--stdio"]
}
}
}Completely quit and reopen Claude Desktop. Look for the hammer icon (🔨) in the chat input to see all CodeMCP tools ready.
Connect Browser-Based AI
Connect web interfaces (ChatGPT, Claude Web, Google AI Studio, Lovable, v0) to your local files using CodeMCP's encrypted ngrok tunnel.
ChatGPT Setup (Custom Plugin & Developer Mode)
Connect ChatGPT in your browser directly to your local project using Developer Mode Plugins (via Streamable HTTP / MCP), without needing to build or configure a Custom GPT.
In your local terminal, run npx @mahesh2-lab/codemcp. Copy the generated global tunnel endpoint and session password:
- Open chatgpt.com in your browser and sign in.
- Click your user avatar in the bottom-left / top-right corner and select Settings.
- Navigate to Security and login (or Developer / Advanced settings).
- Toggle Developer mode to ON.
- In ChatGPT, open the Plugins panel (or click the + (Add) button in the chat composer).
- Select Create MCP App or Develop your own plugin / Add custom server.
- Fill in your connection details:
- Plugin Name:
CodeMCP - Connection Type: Select Streamable HTTP (or SSE)
- Server URL:
https://<your-tunnel-subdomain>.ngrok-free.app/mcp - Authentication: Select Bearer Token and paste your CodeMCP Session Password (
<your-session-password>)
- Plugin Name:
- Click Save & Connect. ChatGPT will perform an MCP handshake and auto-discover all exposed tools (
read_file,write_file,search_code,list_directory).
Start any normal chat in ChatGPT. With Developer mode / the CodeMCP plugin active in the composer, ask:
"Inspect my codebase and tell me how the authentication and routing are structured."
ChatGPT invokes your local tools via Streamable HTTP in real time. Your local terminal displays access logs with zero delay!
If you want to package CodeMCP into a shareable Custom GPT instead of a workspace plugin, go to chatgpt.com/gpts/editor → Configure → Actions → Import https://<your-tunnel>/openapi.json with Bearer API Key auth.
Model Context Protocol Tool Specs
read_file(path, offset, limit)
Reads the contents of a specific file within the bounded project root. Throws a permission error if path escapes root or matches `.mcpignore`.
write_file(path, content, overwrite)
Writes or overwrites a file. Triggers interactive terminal diff confirmation if manual approval is enabled.
search_code(query, pattern, max_results)
Performs rapid regex and substring searches across non-ignored project files with line numbering.
list_directory(path, recursive)
Provides structured file tree listings, directory counts, and file size metadata.