File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -31,23 +31,21 @@ LLM's context without performing computation or causing side effects.
3131Resources can be static (fixed URI) or use URI templates for dynamic content:
3232
3333``` python
34- import json
35-
3634from mcp.server.mcpserver import MCPServer
3735
3836mcp = MCPServer(" Demo" )
3937
4038
4139@mcp.resource (" config://app" )
42- def get_config () -> str :
40+ def get_config () -> dict :
4341 """ Expose application configuration."""
44- return json.dumps( {" theme" : " dark" , " version" : " 2.0" })
42+ return {" theme" : " dark" , " version" : " 2.0" }
4543
4644
4745@mcp.resource (" users://{user_id} /profile" )
48- def get_profile (user_id : str ) -> str :
46+ def get_profile (user_id : str ) -> dict :
4947 """ Get a user profile by ID."""
50- return json.dumps( {" user_id" : user_id, " name" : " Alice" })
48+ return {" user_id" : user_id, " name" : " Alice" }
5149```
5250
5351<!-- TODO: See [Resources](server/resources.md) for full documentation. -->
You can’t perform that action at this time.
0 commit comments