Commit graph

41 commits

Author SHA1 Message Date
Jeremiah Lowin
b62ed3408b
Support non-serializable values in Context.set_state (#3171)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-12 15:06:42 -06:00
Jeremiah Lowin
884b81a0f8
Add dependency injection documentation and DI-style dependencies (#2980) 2026-01-22 09:08:20 -05:00
Jeremiah Lowin
3af9de197a
Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00
Jeremiah Lowin
0e4d519c86
Rename Enabled transform to Visibility (#2950) 2026-01-19 20:46:58 -05:00
Jeremiah Lowin
d8ab493664
Add session-specific visibility control via Context (#2917) 2026-01-18 22:31:06 -05:00
Jeremiah Lowin
f603fe094a Remove sync notification infrastructure
Remove send_notification_sync() method, notification queue, and background flusher task. Component add/remove operations happen outside sessions and no longer need notifications.
2026-01-18 17:31:11 -05:00
Jeremiah Lowin
c8c84ff911
Add session-scoped state persistence (#2873) 2026-01-16 14:11:21 -05:00
Jeremiah Lowin
766641a1a5
Add authorization checks to components and servers (#2855) 2026-01-12 19:56:52 -05:00
Jeremiah Lowin
bf3df4dcd5
Add transport property to Context (#2850) 2026-01-12 15:33:59 -05:00
Jeremiah Lowin
ae3c2abbf6
Consolidate notification system with unified API (#2710) 2025-12-24 16:05:08 -05:00
Chris Guidry
66aaf420c9
[2.14] SEP-1686 tasks (#2378)
* Implement MCP background tasks (SEP-1686) using Docket

Adds support for background task execution via the MCP task protocol,
powered by Docket for task queue management.

- Tools, resources, and prompts can be marked with `task=True` to run async
- Progress dependency for tracking task progress
- CurrentDocket and CurrentWorker dependencies for advanced use cases
- Client API with `.call_tool(..., task=True)` returns task handles
- Task status notifications via subscriptions
- CLI worker command for distributed task processing

Configuration via environment:
- FASTMCP_ENABLE_DOCKET=true
- FASTMCP_ENABLE_TASKS=true
- FASTMCP_DOCKET_URL=redis://... (or memory:// for single-process)

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix tasks example import (TaskStatusResponse → GetTaskResult)

The example was using a non-existent TaskStatusResponse type.
Updated to use mcp.types.GetTaskResult which is what the
on_status_change callback actually receives.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix env var name in Docket error messages

The error messages referenced FASTMCP_EXPERIMENTAL_ENABLE_DOCKET but the
actual setting is FASTMCP_ENABLE_DOCKET.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove deprecated code re-added from pre-#2329 branch

- Remove ExtendedEnvSettingsSource (FASTMCP_SERVER_ prefix support)
- Remove dependencies parameter from FastMCP.__init__

* Replace fakeredis git pin with PyPI release

* Remove redundant fakeredis dev dep (pulled via pydocket)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-12-04 20:10:35 -05:00
Jeremiah Lowin
bc076cba12
Handle request_context availability during MCP initialization (#2400)
The on_initialize hook (2.13.0) runs before the MCP session is established, causing request_context
to be unavailable. Changed request_context to return None instead of raising, allowing middleware to
check availability and use HTTP helpers when needed. Updated docs to guide this pattern.

Closes #2393
2025-11-15 10:50:24 -05:00
Jeremiah Lowin
a359b0b28d
Document client meta parameter for sending ancillary request data (#2367) 2025-11-04 11:32:31 -05:00
William Easton
1e5776f69c
Add list_resources, list_prompts, and get_prompt methods to Context (#2249)
* Add list_resources, list_prompts, and get_prompt methods to Context

- Add Context.list_resources() to list all available resources
- Add Context.list_prompts() to list all available prompts
- Add Context.get_prompt() to get a specific prompt with arguments
- Update ToolInjectionMiddleware to use new Context methods instead of creating temporary Client instances
- Remove unused Client and FastMCPTransport imports from tool_injection.py

This improves API consistency by allowing middleware/tools to use Context methods directly without needing to create temporary Client instances.

Fixes #2245

Co-authored-by: William Easton <strawgate@users.noreply.github.com>

* Update docs

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: William Easton <strawgate@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-10-24 19:24:02 -04:00
Jeremiah Lowin
577ed6e9a3
Fix middleware example: add context parameter to call_next() (#2215)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
2025-10-24 18:41:00 -04:00
Jeremiah Lowin
be73143960
Clarify context is scoped to single MCP request (#2099) 2025-10-15 06:00:03 -07:00
Jeremiah Lowin
c6768dad5f
Add documentation for get_access_token() dependency function (#1446)
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2025-08-11 13:01:44 -04:00
Maxi Fernandez
845546c53f
docs: update get_state and set_state references (#1306) 2025-07-31 11:04:28 -04:00
Jeremiah Lowin
f835d4b41a
Add docs for context state management (#1227) 2025-07-22 10:13:17 -04:00
Jeremiah Lowin
2a3fa142f8 Update documentation 2025-06-28 15:05:13 -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
28fe5082d2 Add session_id to context documentation
Fast follow to #881 to document the new session_id property.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 18:35:59 -04:00
Jeremiah Lowin
d64077b03b remove empty parens from prompt 2025-06-05 14:56:10 -04:00
Jeremiah Lowin
5a0f57498f remove empty parens from tool 2025-06-05 14:55:32 -04:00
Jeremiah Lowin
b3f80c5374 Add empty parens to docs 2025-06-04 17:39:57 -04:00
Jeremiah Lowin
099d340208 Update tests for prompts 2025-06-04 16:37:41 -04:00
Jeremiah Lowin
d1549c3d35 Remove empty parens 2025-06-04 15:37:55 -04:00
Ian Davenport
94f981ff86
Fix typo in docs.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-21 19:45:59 -04:00
davenpi
9122833998 Expose model preferences in ctx.sample 2025-05-21 19:34:45 -04:00
Jeremiah Lowin
fc02acc85f Update context.mdx 2025-05-06 22:24:53 -04:00
Jeremiah Lowin
6ed95abbde Add dependency docs 2025-05-06 22:06:33 -04:00
Jeremiah Lowin
2d5b211d88 Improve documentation 2025-05-06 19:01:33 -04:00
Jeremiah Lowin
bb7d41a53d get_starlette_request → get_http_request 2025-05-02 17:36:09 -04:00
Jeremiah Lowin
b672468d4f Add support for starlette request 2025-05-02 17:16:43 -04:00
Jeremiah Lowin
eefaadee34 Update docs for context 2025-04-25 21:11:14 -04:00
Jeremiah Lowin
3f793d541c minor docs updates 2025-04-25 18:32:24 -04:00
Jeremiah Lowin
28315a0127 Fix broken links 2025-04-16 10:57:18 -04:00
Jeremiah Lowin
eecd4212ab Improve documentation 2025-04-16 10:56:30 -04:00
Jeremiah Lowin
9d7a6e0684 Fix broken links 2025-04-14 13:17:52 -04:00
Jeremiah Lowin
753c993bb7 Add docs 2025-04-13 11:19:31 -04:00