Commit graph

209 commits

Author SHA1 Message Date
Akshay Parihar
a57a155c2e
Scalekit provider updates (#2413)
* sk-provider updates - aud not enforce, scopes enforce if present

* updating env_prefix, adding debug logs

* updating docs

* ruff formatting

* not changing prefix for backward compatiblity

* backward compatibility changes

* give more preference to base_url than mcp_url if both passed

* updating docs

* refactor

* updating example server

* updating readme of example

* updating docs

* updating tests to reflect what should ideally go in the parameter
2025-11-22 12:22:13 -05:00
William Easton
8e0c6c8685
docs: clarify pytest-asyncio dependency and asyncio mode configuration (#2399)
* docs: clarify pytest-asyncio dependency and asyncio mode configuration

Added a Prerequisites section to the testing documentation explaining:
- pytest-asyncio is required for async test functions and fixtures
- Recommended configuration: asyncio_mode = 'auto' in pyproject.toml
- This eliminates need for @pytest.mark.asyncio decorators

Resolves #2372

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

* feat: add testing_demo example with comprehensive test suite

Add a standalone example project demonstrating FastMCP testing patterns:
- Tools, resources, and prompts with full test coverage
- pytest-asyncio configuration in pyproject.toml
- 18 passing tests showing async fixtures, parametrized tests, and more
- Documentation explaining testing best practices

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

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: William Easton <strawgate@users.noreply.github.com>
2025-11-15 10:34:29 -05:00
Jeremiah Lowin
bbf3050ba7
Improve ToolResult and structured output documentation (#2349)
- Restructured confusing sections: 'Object-like Results' → 'Dictionaries and Objects', 'Non-object Results' → 'Primitives and Collections', 'Complex Type Example' → 'Typed Models'
- Simplified CodeGroup examples to show Tool Definition + MCP Result instead of 3-4 confusing tabs
- Split Primitives/Collections into separate CodeGroups for clarity
- Renamed 'Full Control with ToolResult' → 'ToolResult and Metadata' for better TOC visibility
- Flattened ToolResult documentation with inline field descriptions instead of nested headings
- Added version badge for ToolResult meta field (2.13.1)
- Added clarification that ToolResult meta is separate from @mcp.tool meta
- Improved example server with realistic metadata (execution time, character/word counts)
- Fixed code formatting (multi-line objects, trailing commas)
2025-11-02 17:07:48 -05:00
Brandon Shar
c18782f02b
Add meta support to ToolResult (#2283)
* Add meta to ToolResult

* add this at the client level and test the full integration

* add example

* slipped through linting somehow

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-11-02 16:46:52 -05:00
Jeremiah Lowin
ba47db9b8c
Fix Azure scope validation (#2269)
* Update docs for required scopes

* add scopes

* Fix Azure scope validation

Azure returns unprefixed scopes in JWT tokens but requires prefixed scopes in authorization requests. The previous implementation incorrectly validated tokens against prefixed scopes, causing "invalid_token" errors.

Simplified AzureProvider to use standard JWTVerifier with unprefixed scopes for validation. Scopes are only prefixed when building the Azure authorization URL via _build_upstream_authorize_url() override.

Closes #2263
2025-10-26 11:41:22 -04:00
William Easton
9d4c378e1b
Add "High Value" Ruff Rules (#2255)
* Safe Fixes from ruff

* Fix remaining issues

* lint/check

* Fix mysterious ty check errors

* small cleanup

* pr fixes
2025-10-26 10:20:31 -04:00
Jeremiah Lowin
8099201979
Use platformdirs for settings.home (#2213)
Changes settings.home from `Path.home() / ".fastmcp"` to use platformdirs.user_data_dir(), following platform conventions (~/Library/Application Support on macOS, ~/.local/share on Linux, %APPDATA% on Windows).
2025-10-22 16:06:46 -04:00
zzstoatzz
2ff72476b1 example: allow any str for bridge IP 2025-10-21 20:25:43 -05:00
zzstoatzz
bfa8ec43c1 example: allow any str for bridge IP 2025-10-21 20:25:31 -05:00
zzstoatzz
29b0330882 example: update server init usage 2025-10-21 19:34:08 -05:00
Jeremiah Lowin
e7cde97e5b
Docs (#2145)
* Update fonts + styling

* Update docs.json

* Update welcome.mdx
2025-10-19 20:26:08 -04:00
Jeremiah Lowin
9e78d755c2
Support custom server name, icons, and link in OAuth Proxy consent page (#2135)
* Implement icon support in fastmcp

* Fix icon feature tests

- Update snapshot for ResourceTemplate to include icons field
- Remove OAuth mounting tests (belong to PR #2119, not this feature)

* Update docs

* Customize consent screen

* Use server website link if available

* Anchor link shouldnt have trailing slash

* Remove 'a FastMCP server named' from consent page message

* Update docs
2025-10-18 11:49:26 -04:00
Jeremiah Lowin
91af3cd2ae
Internal refactor of MCP handlers (#2005) 2025-10-05 08:45:10 -04:00
Jeremiah Lowin
66221ed3ec
Remove redirect path for authkit example (#1938) 2025-09-27 12:01:41 -04:00
Jeremiah Lowin
7646eadeb0
Add authkit example (#1935) 2025-09-26 18:33:08 -04:00
Akshay Parihar
7bcf8b562c
Add Scalekit Provider for Enterprise Authentication (#1927)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ravi Madabhushi <ravi.madabhushi@scalekit.com>
Co-authored-by: Ravi Madabhushi <innovativeravi@gmail.com>
Co-authored-by: saif-at-scalekit <saif.shaik@scalekit.com>
2025-09-26 16:58:03 -04:00
Stephan Eberle
5486b5a3b9
Add AWS Cognito OAuth Provider for Enterprise Authentication (#1873)
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-09-25 11:08:45 -04:00
nate nowack
7770e3a6bc
remove lockfile smart_home example (#1892)
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-22 20:07:19 -04:00
Jeremiah Lowin
d36ea42b92
Fix OAuth resource URL handling and WWW-Authenticate header (#1706) 2025-09-02 15:14:05 -04:00
Jeremiah Lowin
05b611b68d
Make openai depedency optional (#1701) 2025-09-02 15:13:37 -04:00
Jeremiah Lowin
8c678b552b
Add resource_server_url parameter to OAuth proxy providers (#1682) 2025-08-30 08:33:13 -04:00
Jeremiah Lowin
6d46192659
Internal refactor: fastmcp config to mcp server config (#1672) 2025-08-29 21:37:39 -04:00
Jeremiah Lowin
1f3f82d245
Implement typed source system for FastMCP configuration (#1607) 2025-08-24 16:32:37 -04:00
Jeremiah Lowin
b34519c356
Update schema path (#1595) 2025-08-23 09:47:58 -04:00
William Easton
d32a2b953e
Fallback to a Completions API when Sampling is not available (#1145) 2025-08-21 07:49:29 -04:00
Jeremiah Lowin
c3d1176a69
Add WorkOS and Azure OAuth providers (#1550) 2025-08-20 16:22:03 -04:00
zzstoatzz
04efab4257 fix: auto-detect URLs in ATProto posts for clickable links
The ATProto MCP server now properly handles URLs in posts by:
- Auto-detecting plain URLs in text and creating facets to make them clickable
- Supporting rich text links with custom anchor text
- Preventing overlap between auto-detected and explicitly provided links

This ensures all URLs are clickable on Bluesky, whether they're plain URLs
in text or rich text links with custom anchors.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 11:31:56 -05:00
zzstoatzz
d3f120a059 undo unnecessary client change 2025-08-20 00:54:09 -05:00
zzstoatzz
5fd8ba1aa4 reauth client 2025-08-20 00:36:16 -05:00
Jeremiah Lowin
2d3d5392f1
feat: introduce fastmcp.json configuration system (#1517) 2025-08-19 16:06:04 -04:00
Jeremiah Lowin
ec015de3b0
Add OAuth proxy that allows authentication with social IDPs without DCR support (#1434) 2025-08-18 13:39:58 -04:00
Jeremiah Lowin
45c4ceb1bd
Update environment note (#1075)
* Update environment note

* Update memory.py
2025-07-07 13:44:19 -04:00
Chanwoo Noh
7a1e332aae fix: update mount_example.py for current fastmcp API
- Update mount() calls to use keyword arguments (server, prefix)
- Replace private API access with public async methods (get_tools, get_resources)
- Fix resource URI handling to use URL parsing instead of string prefixes
- Update resource access to use _mcp_read_resource with proper URI format
- Add urllib.parse import for URL parsing functionality

The mounting API and resource handling changed in recent fastmcp versions,
breaking the mount_example.py functionality. This update ensures the example
works correctly with fastmcp v2.9.0.

Tested on: fastmcp v2.9.0
2025-06-26 14:44:51 +09:00
zzstoatzz
6d19f4369f i dont think i need that 2025-06-23 12:43:42 -05:00
zzstoatzz
560c347949 Add delay between thread posts to ensure proper indexing
- Add 0.5s sleep between posts in create_thread
- Prevents 'Parent post not found' errors
- Ensures each post is indexed before creating replies

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 12:40:20 -05:00
zzstoatzz
5b10fd2107 thread 2025-06-23 12:38:11 -05:00
zzstoatzz
7b14a00b4e remove uv source in example 2025-06-23 02:31:26 -05:00
zzstoatzz
e42f9fec7f fix path in atproto example pyproject 2025-06-23 02:27:08 -05:00
zzstoatzz
dc52874300 update url for main 2025-06-22 23:48:25 -05:00
zzstoatzz
2701de8e7b Move search from resource to tool
- Search is an action with parameters, not a resource
- Resources are for fetching by URI (profile, timeline, notifications)
- Tools are for actions (post, search, follow, like, repost)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 23:28:29 -05:00
zzstoatzz
a5e2cf46fd ope 2025-06-22 23:16:22 -05:00
zzstoatzz
c70ac4284d allow config limit 2025-06-22 23:10:54 -05:00
zzstoatzz
0745f457c8 Refactor ATProto MCP server with unified API
- Consolidate 4 separate posting tools into single flexible 'post' tool
- Reorganize _atproto.py into modular structure with clear separation
- Update demo to test all features comprehensively
- Simplify API: post, follow, like, repost (was 8 tools, now 4)

The unified post tool supports all combinations:
- Simple text posts
- Images (up to 4)
- Rich text (links, mentions)
- Replies and threads
- Quote posts
- Advanced combinations (quote + image, reply + rich text, etc.)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 23:06:53 -05:00
zzstoatzz
d30b1b771d update python verison 2025-06-22 22:39:14 -05:00
zzstoatzz
2502ba8093 Fix strong ref creation and image handling in new features
- Use ComAtprotoRepoStrongRef.Main instead of create_strong_ref
- Fix image posting to properly handle downloads and uploads
- Add follow_redirects for image URLs
- All features now tested and working

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 22:39:14 -05:00
zzstoatzz
3264c85606 Add advanced ATProto features: replies, rich text, quotes, and images
- Add reply_to_post for threaded conversations
- Add post_with_rich_text for clickable links and mentions
- Add quote_post for sharing with commentary
- Add post_with_images for visual content (up to 4 images)
- Update types with new response structures
- Add httpx dependency for image downloads
- Document AI assistant use cases in README
2025-06-22 22:39:14 -05:00
zzstoatzz
0e89236185 update python verison 2025-06-22 22:39:14 -05:00
zzstoatzz
6905a00b0b Fix ATProto API calls for follow, like, and repost
- Fix follow_user to use params dict for search_actors API
- Add CID fetching for like_post (required by atproto API)
- Add CID fetching for repost (required by atproto API)
- Both like and repost now fetch the post first to get its CID
2025-06-22 22:39:14 -05:00
zzstoatzz
2eb10094b5 Refactor ATProto example to use resources and proper type annotations
- Add TypedDict definitions for all responses in types.py
- Convert read operations to resources (status, timeline, search, notifications)
- Keep state-modifying operations as tools (post, follow, like, repost)
- Add proper type annotations with Annotated and Field descriptions
- Update demo to use read_resource for resources
- Better separation of concerns with typed interfaces
2025-06-22 22:39:14 -05:00
zzstoatzz
5c23ac8ee9 Refactor ATProto example with modular design and improved demo
- Create _atproto.py module for private implementation details
- Clean server.py to only expose public API (tools)
- Update demo with --post flag instead of comments
- Better separation of concerns
2025-06-22 22:39:14 -05:00