Add test files
This commit is contained in:
31
test_mcp.py
Normal file
31
test_mcp.py
Normal file
@ -0,0 +1,31 @@
|
||||
# import anthropic
|
||||
# import configparser as ini_parser
|
||||
|
||||
# ini = ini_parser.ConfigParser()
|
||||
# ini.read('anthropic.ini')
|
||||
|
||||
# client = anthropic.Anthropic(
|
||||
# api_key = ini['API']['API_KEY']
|
||||
# )
|
||||
|
||||
path_project = "C:\projects\gencpp\base"
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
mcp = FastMCP("Demo")
|
||||
|
||||
@mcp.resource("echo://{message}")
|
||||
def echo_resource(message: str) -> str:
|
||||
"""Echo a message"""
|
||||
return f"Resource echo: {message}!"
|
||||
|
||||
@mcp.tool()
|
||||
def echo_tool(message: str) -> str:
|
||||
"""Echo a message as a tool"""
|
||||
return f"Tool echo: {message}"
|
||||
|
||||
|
||||
@mcp.prompt()
|
||||
def echo_prompt(message: str) -> str:
|
||||
"""Create an echo prompt"""
|
||||
return f"Please process this message: {message}"
|
Reference in New Issue
Block a user