Commit graph

267 commits

Author SHA1 Message Date
Jeremiah Lowin
38d772b437
Support importing custom_route endpoints when mounting servers (#1470)
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-12 12:57:38 -04: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
Jeremiah Lowin
1df4771909
Ensure transformed tools generate structured content (#1443) 2025-08-11 12:34:43 -04:00
Yann Jouanin
456b22ecf4
Enable Protected Resource Metadata to provide resource_name and resou… (#1371)
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-08-10 09:01:12 -04:00
Panos Argyrakis
c3f4623690
fixes #1398: Add JWT claims to AccessToken (#1399)
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-08-09 20:58:09 -04:00
Jeremiah Lowin
19a4dd85d4
Ensure resource + template names are properly prefixed when importing/mounting (#1423) 2025-08-08 21:29:07 -04:00
Jeremiah Lowin
87e103222e
Improve redirect handling to address 307's (#1387) 2025-08-08 11:55:30 -04:00
Jeremiah Lowin
77bdc9de20
Add remote auth provider tests (#1351) 2025-08-06 13:13:35 -04:00
bianning
78e9bab244
Add async support to client_factory in FastMCPProxy (#1286) (#1375)
Co-authored-by: bianning <bianning@vv.cn>
2025-08-06 13:11:48 -04:00
Jeremiah Lowin
aedb1993a2
Remove unused arg (#1382) 2025-08-06 11:09:17 -04:00
William Easton
e62d2dd3c2
Manually set _key after model_copy (#1357) 2025-08-04 11:08:51 -04:00
Jeremiah Lowin
ec52e74b48
Introduce RemoteAuthProvider for cleaner external identity provider integration, update docs (#1346) 2025-08-02 20:36:38 -04:00
Jeremiah Lowin
b46d4934a8
Add comprehensive OAuth 2.1 authentication system with WorkOS integration (#1327) 2025-08-01 17:06:55 -04:00
Jeremiah Lowin
df284ba824
Add unit tests and docs for denying tool calls with middleware (#1333) 2025-08-01 16:55:42 -04:00
William Easton
cae431c001
Remove unused TimedCache (#1303) 2025-07-31 23:10:08 -04:00
Jeremiah Lowin
6fdb8d6a1c
Add test for proxy tags visibility (#1302) 2025-07-30 11:01:07 -04:00
Jeremiah Lowin
60ca72bb0b
Add complete support for TokenVerifier protocol (#1297) 2025-07-29 20:01:40 -04:00
Daniel Campos Olivares
448e794dc7
feat: Allow Resource Metadata URL as field in OAuthProvider (#1287) 2025-07-29 17:40:46 -04:00
Jeremiah Lowin
3fc2510110
Add meta parameter support to tools, resources, templates, and prompts decorators (#1294) 2025-07-29 17:16:05 -04:00
Jeremiah Lowin
0691701951
Add _fastmcp meta namespace (#1290) 2025-07-29 15:07:53 -04:00
Jeremiah Lowin
0adb317361
Ensure proxy components forward meta dicts (#1282) 2025-07-29 10:34:41 -04:00
Jeremiah Lowin
337cd41f5f Sort tags for deterministic output 2025-07-28 18:11:32 -04:00
Jeremiah Lowin
eda798fa0a Note that OpenAPI components automatically load tags 2025-07-28 18:06:24 -04:00
Jeremiah Lowin
a41aba3486 Add tags to meta 2025-07-28 17:38:18 -04:00
Jeremiah Lowin
07655e6620
Fix typing, add tests for tool call middleware (#1269) 2025-07-25 18:46:48 -04:00
Tapan Chugh
51ceb23291
feat: Add Annotations support for resources and resource templates (#1260)
Co-authored-by: Tapan Chugh <tapanc@cs.washington.edu>
2025-07-25 15:16:15 -04:00
Jeremiah Lowin
d04840560a
Support string annotations (#1255) 2025-07-24 14:28:58 -04:00
hopeful0
40f11d2186
Fix stateful proxy client mixing in multi-proxies sessions (#1245) 2025-07-23 15:39:50 -04:00
hopeful0
ca74b44d62
Refactor get_http_request and context.session_id (#1242) 2025-07-23 10:05:46 -04:00
Sourav Tripathy
126dd7b16a
Logcapture addition to test_server file (#1229) 2025-07-22 13:49:49 -04:00
Mukul Murthy
544bc22baa
Add state dict to Context (#1118) (#1160)
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-07-22 10:03:33 -04:00
Tapan Chugh
1da1eb581a
Skip repeated type conversion and validation in proxy client elicitation handler (#1222)
Co-authored-by: Tapan Chugh <tapanc@cs.washington.edu>
2025-07-22 08:08:39 -04:00
Jeremiah Lowin
4a38784194
Introduce experimental OpenAPI parser with improved performance and maintainability (#1209) 2025-07-21 16:17:36 -04:00
Jeremiah Lowin
f950b8ca95
Support from __future__ import annotations (#1199) 2025-07-20 21:05:13 -04:00
William Easton
1b953820b3
[🐶] Transform MCP Server Tools (#1132)
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-07-19 15:52:47 -04:00
hopeful0
85ebe5b657
Add StatefulProxyClient (#1109) 2025-07-19 15:51:58 -04:00
Martin Melka
3543c13ca9
Fix nesting when making OpenAPI arrays and objects optional (#1178) 2025-07-18 08:26:42 -04:00
Aidan
ebe817601c
add server name to mounted server warnings (#1147) 2025-07-17 12:02:30 -07:00
Johannes Maron
7966514a86
Resolve #1139 -- Implement include_context argument in Context.sample (#1141) 2025-07-15 07:01:41 -07:00
Jeremiah Lowin
7ce0a59ea6
Fix optional parameter validation in OpenAPI integration (#1135)
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-13 10:23:56 -04:00
Jeremiah Lowin
b853bb85f9 Expand empty parameter filtering and add tests
Builds on PR #1128 by adding comprehensive filtering at parameter selection stage and test coverage for empty arrays/dicts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 09:25:05 -04:00
Jeremiah Lowin
767de312f9
Fix middleware list result types (#1125)
* Catch more openapi changes

* Simplify middleware list operations to use lists directly

- Updated middleware signatures to work with list[Tool], list[Resource], etc instead of wrapper objects
- Removed unnecessary ListToolsResult, ListResourcesResult wrapper types
- Updated documentation to show simpler list-based filtering pattern
- Added tests for list-based middleware filtering

Closes #1121

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-11 18:04:20 -04:00
Jeremiah Lowin
b0f45a85c4
Fix OpenAPI deepObject style parameter encoding (#1122)
* Fix OpenAPI deepObject style parameter encoding

Add support for deepObject style with explode=true to properly serialize
object parameters using bracket notation (param[key]=value) instead of
JSON strings. Fixes #1114.

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

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

* Create README_OPENAPI.md

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-11 12:50:19 -04:00
Jeremiah Lowin
5d95ddd8c0 Fix OpenAPI parameter name collisions with location suffixing
Resolves parameter conflicts when same name appears in path/query/header
and request body by adding double underscore suffixes (id__path, id__query).
Body parameters keep original names for natural REST API patterns.

Closes #1100

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 18:49:00 -04:00
Jeremiah Lowin
f25bef7e21 Add mirrored component support for proxy servers
Prevents enable/disable operations on mirrored components (tools, resources, prompts retrieved from proxy servers). Users must create local copies with .copy() and add them to their server to modify them. Local components take precedence over mirrored ones.

Closes #1102

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 17:54:40 -04:00
Jeremiah Lowin
09fae7541e
Fix OpenAPI tool name registration when modified by mcp_component_fn (#1096)
Resolves issue where tools modified by mcp_component_fn were registered
with original names but accessible with modified names, causing "Unknown tool"
errors. Now tools are registered using their final modified names.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-08 21:28:46 -04:00
Jeremiah Lowin
c452164e86
Fix concurrent proxy client operations with session isolation (#1083)
* Refactor Client session state with ClientSessionState dataclass

Fixes #1068 by introducing ClientSessionState to encapsulate session management
attributes, simplifying Client.new() and preventing concurrent proxy client
context mixing through client factory pattern.

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

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

* Update proxy documentation for new client factory pattern

Documents the new session management behavior, client_factory parameter,
and concurrent operation safety introduced in v2.10.3 to fix #1068.

* Remove deprecation of client parameter and update documentation

- Undeprecated FastMCPProxy client parameter
- Made client_factory the advanced option for custom control
- Added detailed explanation of how client factories work internally
- Removed outdated note about proxy feature limitations
- Removed fabricated Advanced Usage section

* Re-do proxy documentation

* Fix deprecated client parameter to provide session isolation

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-08 17:22:43 -04:00
Jeremiah Lowin
6c9263001b
Add output schema support for OpenAPI tools (#1073)
* Add output schema support for OpenAPI tools

Implement automatic output schema extraction from OpenAPI responses for
FastMCP tools, addressing issue #1070. Tools generated from OpenAPI specs
now have meaningful output schemas instead of null, improving agent
efficiency when working with structured API responses.

- Add extract_output_schema_from_responses() function to parse response schemas
- Enhance OpenAPITool to accept and use output schemas with proper wrapping
- Automatically wrap non-object responses to comply with MCP requirements
- Include schema definitions and compress unused ones
- Add comprehensive test suite covering object, array, and primitive responses
- Update existing tests to handle structured output with proper typing
- Maintain backward compatibility for specs without response schemas

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

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

* Move output schema tests to dedicated test file

Reorganize output schema tests into test_openapi_output_schemas.py to keep
the main test_openapi.py file focused and smaller, as requested. Added two
additional tests for schema definitions handling.

- Move all extract_output_schema_from_responses() tests to new file
- Add tests for schema definitions inclusion
- Remove output schema imports from main test file

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-07 12:51:01 -04:00
Jeremiah Lowin
0600834da4 Fix single-element list unwrapping in tool content
Single-element lists like [1] were being incorrectly unwrapped to "1"
in unstructured content while multi-element lists remained as lists.
This created inconsistent behavior where the structure was lost for
single items.

This fix ensures lists always preserve their structure in unstructured
content regardless of length, making behavior consistent and predictable.

Also removes pretty-printing from JSON serialization for more compact
output across tools, prompts, and resources.

Fixes #1064

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 12:07:16 -04:00
Jeremiah Lowin
96194bd40f Remove asyncio mark 2025-07-06 21:14:30 -04:00