Commit graph

15 commits

Author SHA1 Message Date
Jeremiah Lowin
cd483a1432
docs: improve contributor guidelines for framework contributions (#3653) 2026-03-27 10:43:12 -04:00
Jeremiah Lowin
b9ea53618d
fix: resolve CurrentFastMCP/ctx.fastmcp to child server in mounted background tasks (#3651) 2026-03-27 10:24:17 -04:00
Jeremiah Lowin
9d1a9cccd8
Add release instructions to CLAUDE.md (#3583) 2026-03-22 09:57:47 -04:00
Jeremiah Lowin
f9ed06176a
fix: route ResourcesAsTools/PromptsAsTools through server middleware (#3495)
* fix: enforce auth/visibility in ResourcesAsTools and PromptsAsTools for non-FastMCP providers

🤖 Co-authored-by: Claude <noreply@anthropic.com>

* fix: honor stdio auth bypass and correct transform ordering in provider wrappers

Co-authored-by: Claude <noreply@anthropic.com>

* fix: move context/dependencies imports into function to break circular import

* fix: route ResourcesAsTools/PromptsAsTools through ctx.fastmcp

Instead of manually reimplementing auth, visibility, and session
transforms in the transform layer, tool functions now call
ctx.fastmcp.read_resource() / ctx.fastmcp.render_prompt() which
routes through the server's full middleware chain. This matches
the pattern CodeMode uses with ctx.fastmcp.call_tool().

The isinstance(provider, FastMCP) branching is removed entirely.

* feat: add _scope parameter for provider-scoped listing

AggregateProvider can now filter which child providers to query when
listing components. ResourcesAsTools and PromptsAsTools use this to
scope listings to their configured provider while still routing
through ctx.fastmcp for full middleware coverage.

The scope matching walks wrapped providers, so a
WrappedProvider(Namespace, inner=MyProvider) matches if MyProvider
is in the scope list.

* test: add coverage for ResourcesAsTools scoped to a sub-server

* fix: delegate to super() when _scope is None, add AggregateProvider to scope matching

* simplify: remove _scope machinery, route everything through ctx.fastmcp

Reverts the _scope parameter from Provider/AggregateProvider/Server.
ResourcesAsTools and PromptsAsTools now simply route through
ctx.fastmcp for all operations. Apply to a FastMCP server instance
for proper auth/visibility/middleware coverage.

Tests rewritten to use FastMCP server directly instead of raw providers.

* warn when ResourcesAsTools/PromptsAsTools is applied to a non-FastMCP provider

* docs: explain that ResourcesAsTools/PromptsAsTools should wrap a FastMCP server

* raise TypeError instead of warning when applied to non-FastMCP provider

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-15 16:35:54 -04:00
Jeremiah Lowin
d4a8354ba2
Add settings and environment variables reference (#3384)
* Add settings reference page

* Note .env caveat for nested Docket settings
2026-03-04 15:29:31 -05:00
Jeremiah Lowin
72129c3d03 Fix symlink note in CLAUDE.md 2026-02-27 21:38:07 -05:00
Jeremiah Lowin
c96c0400f3
feat: Search transforms for tool discovery (#3154)
* feat: Add search transforms for tool discovery

RegexSearchTransform and BM25SearchTransform collapse large tool
catalogs into a search interface so LLMs discover tools on demand
instead of receiving the full listing.

* chore: Update SDK documentation

* fix: call_tool recursion guard, atomic BM25 rebuild, hash includes descriptions

* Extract CatalogTransform base class for catalog-aware transforms

Transforms that replace list_tools() with synthetic components (like
search) need to read the real catalog at call time without triggering
their own replacement logic. CatalogTransform handles the re-entrant
bypass via per-instance ContextVar, exposing transform_tools() as the
subclass hook and get_tool_catalog() for catalog access.

* Add search transform examples for regex and BM25

* Add README for search transform examples

* Polish search example clients with rich output

* Remove hardcoded tool counts from search example subtitles

* Clarify that review bot feedback should be evaluated on its merits

* Expand search transform docs with proper hierarchy

---------

Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-26 22:42:38 -05:00
Jeremiah Lowin
270783e614
reverse CLAUDE.md/AGENTS.md symlink direction (#3294) 2026-02-25 11:18:59 -05:00
Jeremiah Lowin
bfc8efdf31
Consolidate agent instructions into AGENTS.md (#1404) 2025-08-08 11:55:06 -04:00
Jeremiah Lowin
2690878412 Update middleware imports and documentation 2025-06-30 18:35:16 -04:00
Jeremiah Lowin
3805ac9b44 Provide a response type to client 2025-06-28 09:47:14 -04:00
Jeremiah Lowin
38036b1f42 Add automatic MCP list change notifications and client message handling
Implements comprehensive notification system for tools, resources, and prompts with automatic client updates and flexible message handlers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 22:33:06 -04:00
Jeremiah Lowin
84ca1b0f09 Update CLAUDE.md 2025-06-22 20:09:14 -04:00
Jeremiah Lowin
ac252fc28f Fix CORS documentation example to properly handle preflight requests
The previous example only allowed GET methods, causing browser preflight
requests to fail with "Disallowed CORS method" errors. Updated to include
the required parameters for proper CORS support with MCP clients.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:27:22 -04:00
Jeremiah Lowin
3ce613b43a Add CLAUDE.md with FastMCP development guidelines
Establishes preference for in-memory transport when testing/investigating FastMCP servers, and recommends StreamableHttp over SSE for HTTP transport needs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 18:00:53 -04:00