-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
39 lines (27 loc) · 878 Bytes
/
tools.py
File metadata and controls
39 lines (27 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""MCP Tools for simple-mcp-server.
This module defines the MCP tools (echo, ping) that are exposed to clients.
For ros-mcp-server merge, replace these with ROS-specific tools.
"""
import logging
from fastmcp import FastMCP
logger = logging.getLogger(__name__)
# Create the FastMCP server instance
mcp = FastMCP("simple-mcp-server")
@mcp.tool()
def echo(message: str) -> str:
"""Echo back the input message.
Args:
message: The message to echo back
Returns:
The echoed message with a prefix
"""
logger.info(f"[TOOL] echo invoked, message length: {len(message)}")
return f"Echo: {message}"
@mcp.tool()
def ping() -> str:
"""Simple ping tool to test connectivity.
Returns:
A pong response
"""
logger.info("[TOOL] ping invoked")
return "pong from Mok's computer"