Skip to content

Commit 63dcf96

Browse files
authored
Merge pull request #199 from UiPath/fix/update_simple_mcp_sample
fix: update simple mcp sample
2 parents ead77c6 + 656d138 commit 63dcf96

File tree

4 files changed

+730
-807
lines changed

4 files changed

+730
-807
lines changed

samples/simple-local-mcp/pyproject.toml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ version = "0.0.1"
44
description = "Math and Weather Local MCP Server Agent"
55
authors = [{ name = "John Doe", email = "[email protected]" }]
66
dependencies = [
7-
"langgraph>=0.2.70",
8-
"langchain-core>=0.3.34",
9-
"langchain-anthropic>=0.3.9",
10-
"langgraph-checkpoint-sqlite>=2.0.3",
11-
"python-dotenv>=1.0.1",
12-
"uipath-langchain==0.0.124",
13-
"pydantic>=2.10.6",
14-
"aiohttp>=3.11.12",
15-
"typing-extensions>=4.12.2",
16-
"langchain-mcp-adapters>=0.1.0",
17-
"ipython>=8.32.0",
18-
"mcp>=1.4.1",
7+
"uipath>=2.1.70",
8+
"langchain-anthropic>=0.3.20",
9+
"uipath-langchain>=0.0.135",
10+
"langchain-mcp-adapters>=0.1.10",
11+
"mcp>=1.15.0",
1912
]
2013
requires-python = ">=3.10"
14+
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
import logging
2+
13
from mcp.server.fastmcp import FastMCP
24

5+
logging.basicConfig(level=logging.INFO)
6+
logger = logging.getLogger(__name__)
7+
38
mcp = FastMCP("Math")
49

510
@mcp.tool()
611
def add(a: int, b: int) -> int:
712
"""Add two numbers"""
8-
return a + b
13+
result = a + b
14+
logger.info(f"Adding {a} and {b}: {result}")
15+
return result
916

1017
@mcp.tool()
1118
def multiply(a: int, b: int) -> int:
1219
"""Multiply two numbers"""
13-
return a * b
20+
result = a * b
21+
logger.info(f"Multiplying {a} and {b}: {result}")
22+
return result
1423

1524
if __name__ == "__main__":
1625
mcp.run(transport="stdio")

samples/simple-local-mcp/src/simple-local-mcp/weather_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
import logging
2+
13
from mcp.server.fastmcp import FastMCP
24

5+
logging.basicConfig(level=logging.INFO)
6+
logger = logging.getLogger(__name__)
7+
38
mcp = FastMCP("Weather")
49

510
@mcp.tool()
611
async def get_weather(location: str) -> str:
712
"""Get weather for location."""
13+
logger.info(f"Getting weather for {location}")
814
return "It's always sunny in New York"
915

1016
if __name__ == "__main__":

0 commit comments

Comments
 (0)