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

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 (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".
  • 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:

  • claude-ai-mcp#93: claude.ai does not pass server instructions from the initialize response to the model (31 upvotes). The author works around it by copying them into tool descriptions, "which are themselves truncated".
  • kirodotdev/Kiro#11096: support the MCP server instructions field in agent context.
  • google/adk-python#7696: McpToolset, opt-in support for MCP server instructions.
  • agno-agi/agno#7049: MCPTools should load MCP server instructions during initialization.
  • anthropics/claude-code#43474: server instructions silently truncated when several servers are configured.
  • colbymchenry/codegraph#765: users want to override a server's built-in instructions (--instructions / --add).

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.1.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.1.0
File Size Uploaded Provenance Actions
briefed-0.1.0.tar.gz 21.9 kB Without provenance Details for briefed-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 40.1 kB

Release files / briefed-0.1.0.tar.gz

Download URL briefed-0.1.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
328600c7ac8aeb10db64ea24d636ee00df30252341ead0526f0d64027bd2d18c
BLAKE2b-256 checksum
How to use checksums
6f38197129dee2d8209130798ff0fc775513cc56c7349e416cf21943466cb4b5
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.1.0-py3-none-any.whl

Download URL briefed-0.1.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe2cf272b0607a24a62a6284463da4dc6a8483bd6e36794aa379d83f3f56b220
BLAKE2b-256 checksum
How to use checksums
2d0f549d2c4ec2a8b2059407cc3c1b494e8a5466a3a285aef1def58047236b80
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.1.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.1.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