Skip to main content

briefed

MCP servers can send instructions in their initialize result: how their tools fit together, which one to call first, what the fields mean. Many clients drop that text (claude.ai custom connectors, Kiro, Google ADK, agno and others) or cut it short, so the model never reads it.

briefed puts the instructions where every client's model looks: the tool list. Use it as a stdio proxy around any server, as ASGI middleware for a remote server, or as one function.

pip install briefed
pip install "briefed[http]"    # plus `briefed http` for remote servers (httpx, uvicorn)

Quick start: any stdio server, no code changes

Put briefed proxy -- in front of the server command in your client's config:

{
  "mcpServers": {
    "catalog": {
      "command": "briefed",
      "args": ["proxy", "--", "npx", "-y", "@acme/catalog-mcp"]
    }
  }
}

The model now sees one more tool, server_instructions, that returns the server's instructions, and each tool description ends with (Call server_instructions once before using this server's tools.). The proxy answers that tool itself; everything else passes through unchanged.

Check what a server sends first:

$ briefed show -- npx -y @acme/catalog-mcp
catalog sends 412 characters of instructions:
...

briefed show exits 1 when the server sends no instructions (handy in CI).

Proxy options

Option What it does
--mode tool Default. Adds the server_instructions tool plus a one-line hint per tool. Long instructions stay whole.
--mode inline Puts the instructions at the top of the first tool's description (or --target TOOL). No extra call, but clients that cut long descriptions cut them too.
--instructions TEXT or @FILE Use your own instructions instead of the server's (for servers that send none, or send wrong ones).
--add TEXT or @FILE Add your own text after the server's instructions (team rules, workspace notes).
--tool-name NAME Name of the added tool (default server_instructions).
--no-hint Don't add the hint line to each description.
--move Also remove instructions from initialize, so clients that do read them don't get them twice.

Remote servers you don't run: briefed http

For a hosted MCP server (a URL, not a command) used from a client on your machine, such as Claude Code, Claude Desktop, Gemini CLI, Kiro or an ADK agent, run a local proxy in front of it and point the client at the proxy:

$ briefed http https://mcp.example.com/mcp --port 8080
briefed: forwarding to https://mcp.example.com/mcp; point your client at http://127.0.0.1:8080/mcp
{
  "mcpServers": {
    "catalog": {
      "type": "http",
      "url": "http://127.0.0.1:8080/mcp"
    }
  }
}

Every path and method is forwarded, headers included (Authorization, Mcp-Session-Id, the OAuth .well-known routes), and SSE streams come back as they arrive. The proxy learns the instructions from the initialize (or server/discover) reply on the way through and answers server_instructions itself. It takes the same options as briefed proxy (--mode, --instructions, --add, --tool-name, --target, --no-hint, --move), plus --host, --port and --timeout.

Your own remote server (claude.ai custom connectors): ASGI middleware

claude.ai reaches your server over Streamable HTTP, so a local proxy can't help. Wrap the server's ASGI app instead. With the MCP Python SDK:

from mcp.server.fastmcp import FastMCP   # SDK 2.x: from mcp.server.mcpserver import MCPServer
from briefed.asgi import Briefed

INSTRUCTIONS = "Call search before get. All dates are UTC. Use has_price to filter tradeable bonds."
mcp = FastMCP("catalog", instructions=INSTRUCTIONS)

@mcp.tool()
def search(q: str) -> list:
    """Search the catalog by keyword."""
    ...

app = Briefed(mcp.streamable_http_app(), INSTRUCTIONS)   # run with: uvicorn server:app

The middleware works with any ASGI framework (Starlette, FastAPI, the SDK's app). It reads each POST body to see which JSON-RPC requests it holds, answers server_instructions calls itself, and rewrites initialize and tools/list responses in both application/json and SSE (text/event-stream) form. GET streams, DELETE, other status codes and compressed bodies pass through untouched. Options are the same as the proxy's: mode, tool_name, target, hint, extra, keep=False (the proxy's --move) and path="/mcp" to limit it to one route.

Pass the instructions explicitly (as above) for stateless or multi-process servers, where a tools/list request can reach a process that never saw an initialize. Without them, the middleware uses the text from the last initialize result it saw.

In your own code

from briefed import Brief

brief = Brief("Call search before get. All dates are UTC.")
tools = brief.tools(tools)                 # MCP tool dicts -> new list, input not changed

if brief.handles(name):                    # a tools/call for server_instructions
    return brief.call_result()

fold(tools, instructions, **options) is the same as Brief(instructions, **options).tools(tools). Brief(...).initialize_result(result, keep=True) learns the server's instructions from an initialize result (and with keep=False returns it without them).

Limits

  • The model has to call server_instructions before it reads them. The hint line on every tool makes that likely, not certain. Inline mode avoids the call but is cut by clients that cut descriptions (about 1,024 characters is common; briefed show warns above that).
  • Only the first page of a paged tools/list gets the extra tool.
  • If the server already has a tool with the same name, briefed adds nothing in tool mode; pick another --tool-name.
  • The ASGI middleware does not answer a server_instructions call inside a JSON-RPC batch (batches were removed from MCP in 2025-06-18); the server gets it and answers "unknown tool".
  • briefed http runs on your machine, so it helps clients that run there. claude.ai custom connectors connect from Anthropic's servers; for those, the server itself needs the ASGI middleware. The proxy learns the instructions when a client's initialize or server/discover goes through it; if a client reuses a session it opened before the proxy started, pass --instructions (or restart the client).
  • Instructions are learned from initialize (and from server/discover results that carry an instructions field). Changes the server makes later reach the model on the next listing.

Why this exists

Server authors keep finding that the model ignores guidance they put in instructions:

Part of kitforge. Related: toolcap (results over the token limit), schemashim (schemas Gemini or OpenAI strict reject), cleanpipe (servers that print to stdout).

License

MIT

Metadata

Release files for briefed 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for briefed 0.2.0
File Size Uploaded Provenance Actions
briefed-0.2.0.tar.gz 27.1 kB Without provenance Details for briefed-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for briefed 0.2.0
File Interpreter ABI Platform Actions
briefed-0.2.0-py3-none-any.whl Python 3 none any Details for briefed-0.2.0-py3-none-any.whl

Total release size: 49.3 kB

Release files / briefed-0.2.0.tar.gz

Download URL briefed-0.2.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ab1338dda146cb0c4bea4c128518002e949a84c2004fff3609916e578a3573a8
BLAKE2b-256 checksum
How to use checksums
2c04b89b6dd543351b9ecd09d22cc19ce5239eb924050b1d074062021176c476
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / briefed-0.2.0-py3-none-any.whl

Download URL briefed-0.2.0-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f88ffc9c27385018229fa75911c8c1a41516c720f9f20d90693c863dc695dffa
BLAKE2b-256 checksum
How to use checksums
16756cbaf3221b96bd19bfad3e713f57521d2afecbdd139172df200e595b0d24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for briefed 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page