Skip to main content
Glama
README.md
# Loop MCP

A standalone Model Context Protocol server for DeepSeek Search, Fetch, OCR, ASR and TTS. Requires Node.js 24 or newer.

## STDIO

Configure your MCP client to start the package with `npx -y @loop-harness/mcp@0.1.0`. Pass `DEEPSEEK_API_KEY` as an environment variable or add `--env-file PATH` to the command. From a source checkout, install with `pnpm install --frozen-lockfile` and use `node src/cli.js --env-file .env` as the launch command.

STDIO runs with the invoking user's filesystem access. OCR and ASR take `file.path` and send the file to DeepSeek. TTS takes `output_path` and writes a new WAV without replacing an existing file. Parent directories must exist.

## Streamable HTTP

Generate a separate client token with `openssl rand -hex 32` and store it as `LOOP_MCP_HTTP_TOKEN` alongside the DeepSeek key in your local environment. Start the server:

```bash
npx -y @loop-harness/mcp@0.1.0 --transport http --env-file .env
```

Connect to `http://127.0.0.1:8787/mcp` using Streamable HTTP with an `Authorization: Bearer <client-token>` header. The server uses stateless POST requests from native clients. Put it behind HTTPS before allowing remote connections. `--host` and `--port` override the localhost defaults.

OCR and ASR take `file.filename` and `file.base64` over HTTP, up to 8 MiB per file. TTS returns WAV as MCP audio content. Clients must support audio results and allow time for synthesis. For long output where base64 would be expensive, use STDIO with a local output path. HTTP client disconnect cancels local work. DeepSeek may finish and bill an OCR job after receiving its file.

## Tools

| Tool | Description |
| --- | --- |
| `deepseek_search` | Searches public webpages. Defaults to the upstream result count and summary-only output. |
| `deepseek_fetch` | Returns a public webpage's main content as Markdown. |
| `deepseek_ocr` | Extracts text from a document or image. Supports normal and layout-aware recognition. STDIO supports files up to 100 MiB. |
| `deepseek_asr` | Transcribes 16-bit PCM WAV or Ogg Opus audio up to 8 MiB and 120 seconds. |
| `deepseek_tts` | Sends complete text in chunks over DeepSeek WebSocket and assembles the returned PCM as WAV. |

Set `LOOP_MCP_TOOLS` to a comma-separated allowlist of tool names to expose a subset. All five are enabled by default. Per-tool queues and concurrency limits are process-local. Requests are never automatically repeated. Upstream timeouts and billing vary by tool.

[Search and Fetch](https://api-docs.deepseek.com/guides/search/) · [OCR](https://api-docs.deepseek.com/guides/ocr/) · [ASR](https://api-docs.deepseek.com/guides/asr/) · [TTS](https://api-docs.deepseek.com/guides/tts/)

## Development and releases

Run `pnpm check` and `pnpm test`. The suite uses local fixtures and requires no API key.

CI checks Linux, macOS and Windows. Release tags must match the package version and point to a commit on `master`. The release workflow publishes the Linux tarball tested by CI after the full matrix passes. Configure npm Trusted Publishing for the GitHub repository and `release.yml` after bootstrapping the package. Only the publish job receives an OIDC token.