Skip to content

Commit 90f021a

Browse files
authored
Merge pull request #95 from UiPath/fix/local-mcp-sample
fix: new usage for MultiServerMCPClient
2 parents 56d81ab + 5ea66a4 commit 90f021a

File tree

4 files changed

+669
-102
lines changed

4 files changed

+669
-102
lines changed

samples/simple-local-mcp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies = [
1313
"pydantic>=2.10.6",
1414
"aiohttp>=3.11.12",
1515
"typing-extensions>=4.12.2",
16-
"langchain-mcp-adapters>=0.0.5",
16+
"langchain-mcp-adapters>=0.1.0",
1717
"ipython>=8.32.0",
1818
"mcp>=1.4.1",
1919
]

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
@asynccontextmanager
1212
async def make_graph():
13-
async with MultiServerMCPClient(
14-
{
13+
client = MultiServerMCPClient({
1514
"math": {
1615
"command": sys.executable,
1716
"args": ["src/simple-local-mcp/math_server.py"],
@@ -22,7 +21,6 @@ async def make_graph():
2221
"args": ["src/simple-local-mcp/weather_server.py"],
2322
"transport": "stdio",
2423
},
25-
}
26-
) as client:
27-
agent = create_react_agent(model, client.get_tools())
28-
yield agent
24+
})
25+
agent = create_react_agent(model, await client.get_tools())
26+
yield agent

samples/simple-local-mcp/uipath.json

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"entryPoints": [
33
{
44
"filePath": "agent",
5-
"uniqueId": "e728db57-9280-4222-84e8-72e9a7adb9e7",
5+
"uniqueId": "35ccd28e-c612-4395-9076-ff0b0db2a104",
66
"type": "agent",
77
"input": {
88
"type": "object",
@@ -24,6 +24,7 @@
2424
"type": "string"
2525
},
2626
{
27+
"additionalProperties": true,
2728
"type": "object"
2829
}
2930
]
@@ -34,10 +35,12 @@
3435
"title": "Content"
3536
},
3637
"additional_kwargs": {
38+
"additionalProperties": true,
3739
"title": "Additional Kwargs",
3840
"type": "object"
3941
},
4042
"response_metadata": {
43+
"additionalProperties": true,
4144
"title": "Response Metadata",
4245
"type": "object"
4346
},
@@ -46,28 +49,10 @@
4649
"type": "string"
4750
},
4851
"name": {
49-
"anyOf": [
50-
{
51-
"type": "string"
52-
},
53-
{
54-
"type": "null"
55-
}
56-
],
57-
"default": null,
58-
"title": "Name"
52+
"type": "string"
5953
},
6054
"id": {
61-
"anyOf": [
62-
{
63-
"type": "string"
64-
},
65-
{
66-
"type": "null"
67-
}
68-
],
69-
"default": null,
70-
"title": "Id"
55+
"type": "string"
7156
}
7257
},
7358
"required": [
@@ -105,6 +90,7 @@
10590
"type": "string"
10691
},
10792
{
93+
"additionalProperties": true,
10894
"type": "object"
10995
}
11096
]
@@ -115,10 +101,12 @@
115101
"title": "Content"
116102
},
117103
"additional_kwargs": {
104+
"additionalProperties": true,
118105
"title": "Additional Kwargs",
119106
"type": "object"
120107
},
121108
"response_metadata": {
109+
"additionalProperties": true,
122110
"title": "Response Metadata",
123111
"type": "object"
124112
},
@@ -127,28 +115,10 @@
127115
"type": "string"
128116
},
129117
"name": {
130-
"anyOf": [
131-
{
132-
"type": "string"
133-
},
134-
{
135-
"type": "null"
136-
}
137-
],
138-
"default": null,
139-
"title": "Name"
118+
"type": "string"
140119
},
141120
"id": {
142-
"anyOf": [
143-
{
144-
"type": "string"
145-
},
146-
{
147-
"type": "null"
148-
}
149-
],
150-
"default": null,
151-
"title": "Id"
121+
"type": "string"
152122
}
153123
},
154124
"required": [

0 commit comments

Comments
 (0)