agent-mcp
Enables web search through Brave when a BRAVE_API_KEY is configured; the websearch tool sends queries to Brave and returns search results.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
agent-mcp
A cross-platform FastMCP server that exposes file, search, shell, and web tools with the same names and input fields as the built-in tools in OpenCode. It runs over Streamable HTTP (with a static bearer token) or stdio, on Linux, macOS, and Windows.
Use it to give an agent controlled access to another machine, or to replace a subset of local tools with a single authenticated MCP endpoint.
OpenCode / any MCP client
│ Authorization: Bearer <token>
▼
http://127.0.0.1:8765/mcp
│
├── read / write / edit / patch
├── glob / grep
├── shell
└── webfetch / websearchTool compatibility
Tool | Parameters (same names as OpenCode) | Behavior |
|
| Numbered lines, 2,000-line / 50 KiB pages, directory listings, images/audio/PDF as MCP media |
|
| Recursive glob, hidden filtering, newest first |
|
| Regex or literal content search; uses |
|
| Exact replacement; errors on ambiguous matches unless |
|
| Create or replace a file, creating parents |
|
|
|
|
| Host shell, millisecond timeout, process-tree kill, background log |
|
|
|
|
| Brave ( |
Not mirrored: question, skill, subagent, and execute are client-side
tools. websearch needs a provider key; it returns a clear error otherwise.
Related MCP server: DevSpace
Install
Requires Python 3.10+.
# from this checkout, in a project virtualenv
uv venv && uv pip install -e .
# or install the CLI in an isolated environment from the checkout
pipx install .
# uv tool install .
# or install directly from the public repository
pipx install "git+https://github.com/uukelele/agent-mcp.git"Run over HTTP
export AGENT_MCP_TOKEN="$(openssl rand -hex 32)"
agent-mcp \
--root /srv/project \
--host 127.0.0.1 \
--port 8765 \
--token "$AGENT_MCP_TOKEN"Endpoint: http://127.0.0.1:8765/mcp.
Every request must send
Authorization: Bearer <token>.Binding a non-loopback address without a token is refused unless you pass
--no-authexplicitly.--statelessremoves MCP session IDs (useful behind buffered proxies).--json-responsereturnsapplication/jsoninstead of request-scoped SSE.--allowed-host/--allowed-originextend FastMCP's Host/Origin guard when running behind a reverse proxy.
For a public deployment, terminate TLS in Caddy/nginx and forward to
127.0.0.1:8765; do not send bearer tokens over plain HTTP across a network.
Run with Docker
export AGENT_MCP_TOKEN="$(openssl rand -hex 32)"
mkdir -p workspace
docker compose up -dThe compose file publishes only 127.0.0.1:8765 and mounts ./workspace as
the sandbox root. The container runs as an unprivileged mcp user, but shell
still executes inside the container with that user's full access to the mounted
workspace. Add --allow-outside-root, --allow-private-web, or other flags to
the compose command only when you need them.
Run over stdio
agent-mcp --transport stdio --root /srv/projectOpenCode starts it for you:
{
"mcp": {
"servers": {
"tools": {
"type": "local",
"command": ["agent-mcp", "--transport", "stdio", "--root", "/srv/project"]
}
}
}
}Connect from OpenCode (HTTP)
Because this server uses a static header token and does not advertise OAuth,
set "oauth": false:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"tools": {
"type": "remote",
"url": "http://127.0.0.1:8765/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:AGENT_MCP_TOKEN}"
}
}
}
}
}CLI equivalent:
opencode mcp add tools --url http://127.0.0.1:8765/mcp \
--header 'Authorization=Bearer {env:AGENT_MCP_TOKEN}'
# `mcp add` does not write oauth:false; add it to the generated entry.
opencode mcp listTool names are prefixed with the server name (for example tools_read,
tools_shell). Under OpenCode's default Code Mode they are grouped under the
server namespace. Set "codemode": false on the server if you want them exposed
directly in the native tool list.
Authentication
--token/AGENT_MCP_TOKEN/MCP_AUTH_TOKENsets the only accepted bearer token. Tokens shorter than 16 characters are rejected.The token is compared with
secrets.compare_digest.--no-authis required to run HTTP without authentication. It is only sensible on loopback.--print-configshows the resolved settings with the token redacted.
Cross-platform behavior
Shell: on Linux/macOS the default is
$SHELL -lc(falling back tobash/sh); on Windows it is PowerShell (pwsh/powershell) with-NoProfile -NonInteractive -Command, falling back tocmd.exe /d /s /c. Override with--shellorAGENT_MCP_SHELL. Background commands write their log to<root>/.agent-mcp/shell/, soreadcan access it inside the sandbox; add that directory to.gitignore.Process trees: timeouts kill the whole tree with
killpgon POSIX andtaskkill /Ton Windows.Encoding: UTF-8, UTF-8/UTF-16/UTF-32 BOMs, BOM-less UTF-16, and the platform ANSI code page are detected. Edits round-trip the original encoding and BOM byte-for-byte.
Newlines: CRLF, LF, and CR are preserved when editing or patching.
Paths: relative paths resolve against
--root; absolute paths are checked withcommonpath, including Windows drive letters. Glob/grep display workspace-relative POSIX paths for consistent agent output.Atomic writes: temp file in the target directory,
fsync, thenos.replace; existing permissions are preserved.
Patch format
*** Begin Patch
*** Add File: hello.txt
+hello
*** Update File: hello.txt
@@
hello
-world
+there
*** Update File: old.txt
*** Move to: new.txt
@@
-a
+b
*** Delete File: gone.txt
*** End PatchEvery operation is parsed and every hunk is matched before anything is written. A missing context line aborts the whole patch. New files are written as UTF-8 with LF; updates keep the file's existing encoding and newline style.
Security model
File access is confined to
--rootunless--allow-outside-rootis set. Symlink targets are resolved before the containment check.shellis not sandboxed. It runs as the server user with that user's full privileges. Run the server as a dedicated, unprivileged account and restrict network access.webfetchblocks loopback, private, link-local, and reserved IPs by default (including redirect targets).--allow-private-webdisables that guard.websearchonly calls Brave or Tavily; no provider key means no request.shellinherits the server environment, including any provider API keys stored there. Run the service under a dedicated account and keep unrelated secrets out of its environment.Keep the token in an environment variable, not in a world-readable config.
Limitations
readreturns PDFs as embedded resources rather than extracting text.grepuses Python'sreengine in the fallback path: lookaround works, but\p{...}and some PCRE syntax do not. With ripgrep, matching uses ripgrep's Rust regex syntax (no lookaround unless--pcre2is added) but is faster. Ripgrep detects UTF-16 with a BOM; BOM-less UTF-16 is covered by the Python fallback. Anchor patterns or narrow withincludefor predictable results.globreturns files, not directories.Background shell commands return immediately; there is no completion notification. Poll the returned log path with
read.The server does not implement OpenCode's permission prompts, snapshots, or
patch-for-GPT-only policy. Your MCP client decides when to call a tool.
Development
uv venv
uv pip install -e ".[dev]" # or: uv pip install -e . pytest httpx
.venv/bin/pytest
.venv/bin/agent-mcp --print-configLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- AlicenseCqualityCmaintenanceA security-first MCP server that provides LLMs with structured tools for filesystem, process, search, build/test/lint, IDE integration, and more.402PolyForm Noncommercial 1.0.0
- AlicenseNot gradedqualityAmaintenanceThis self-hosted MCP server connects an MCP client such as ChatGPT to approved local project folders, enabling file reading and editing, code search, shell command execution, and Git worktree workflows without uploading code to a third party. It also supports mounting external stdio or Streamable HTTP MCP servers as dynamic capabilities.1,285 npmMIT
- AlicenseNot gradedqualityAmaintenanceA local-first MCP server that enables AI-assisted coding through workspace-scoped tools for file reading/editing, command execution, jobs, Git, LSP, media, browser, and desktop workflows. It enforces OAuth, workspace ACL, trust policies, and file/secret guards so owners can safely grant inspect, edit, or trusted capabilities.48 npmMIT
- AlicenseAqualityCmaintenanceA safety-first local MCP server that enables bounded file reading, text search, line-range editing with optimistic locking, and read-only git diff operations within a single code workspace.6MIT