Skip to main content
Glama
MCP Tool Explorer and Local HTTP Bridge

MCP Tool Explorer and Local HTTP Bridge

by zhyzx35607
README.md
# MCP Tool Explorer and Local HTTP Bridge

Connect an existing stdio MCP server, inspect its tools in a browser, and expose the same tools through a local Streamable HTTP endpoint.

## Quickstart

Requires Node.js 22 or newer.

```sh
npm ci
npm run dev -- --demo
```

Open <http://127.0.0.1:3000>. The demo starts a filesystem MCP server rooted at the included `examples/sample-files` directory, where you can list and read the sample file. To select a different directory, pass it after `--demo`:

```sh
npm run dev -- --demo /absolute/path/to/sample-files
```

The filesystem server can read only within that selected directory. Choose a directory containing files you are comfortable exposing to the local tool explorer and HTTP bridge.

## Connect your server

Pass the executable and its arguments after `--command`. Repeat `--arg` for each argument; the bridge starts the server as a child process using stdio:

```sh
npm run dev -- --command npx --arg -y --arg @modelcontextprotocol/server-filesystem --arg /absolute/path/to/notes
```

For example, replace the executable and arguments with those used to start your own stdio MCP server. The bridge lists the server's tools, creates forms from their input schemas, and forwards calls to that server.

## Streamable HTTP

The same tools are available to MCP clients at:

```text
http://127.0.0.1:3000/mcp
```

The server binds to localhost by default. Set `PORT` to change the port, for example `PORT=4317 npm run dev -- --demo`. An MCP SDK client can connect with `StreamableHTTPClientTransport` using that URL, then call `listTools()` and `callTool()` as usual.

The browser explorer uses `GET /api/tools` to load tool names and schemas and `POST /api/tools/:name` with `{ "arguments": { ... } }` to invoke a tool. Results preserve the server's text content, structured content, and tool-reported error flag.

## Development checks

```sh
npm run typecheck
npm run test:protocol
npm run build
```

The protocol smoke starts the demo bridge and uses an MCP SDK client over Streamable HTTP to list the filesystem tools, list the fixture directory, and read a fixture file.