You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Tiny Agents setup on Windows and JSON schema errors
Changes:
Remove invalid JSON comment (\\) from agent.json to fix the JSONDecodeError in Python CLI.
Flatten servers schema by moving command and args out of the nested config object, matching the Tiny Agents spec (prevents “Required: command” validation errors in TS).
Windows-compatible command in agent.json: changed "command": "npx" to "command": "npx.cmd" so the Python CLI can spawn the correct executable on Win32.
Result:
Python runner no longer throws [WinError 193] or JSON parsing errors.
TypeScript runner passes schema validation and connects successfully to the live MCP endpoint.
Copy file name to clipboardExpand all lines: units/en/unit2/tiny-agents.mdx
+18-23Lines changed: 18 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,7 @@ Let's setup a project with a basic Tiny Agent.
65
65
```bash
66
66
mkdir my-agent
67
67
touch my-agent/agent.json
68
+
cd my-agent
68
69
```
69
70
70
71
The JSON file will look like this:
@@ -76,13 +77,11 @@ The JSON file will look like this:
76
77
"servers": [
77
78
{
78
79
"type": "stdio",
79
-
"config": {
80
-
"command": "npx",
81
-
"args": [
82
-
"mcp-remote",
83
-
"http://localhost:7860/gradio_api/mcp/sse"// This is the MCP Server we created in the previous section
84
-
]
85
-
}
80
+
"command": "npx",
81
+
"args": [
82
+
"mcp-remote",
83
+
"http://localhost:7860/gradio_api/mcp/sse"
84
+
]
86
85
}
87
86
]
88
87
}
@@ -91,7 +90,7 @@ The JSON file will look like this:
91
90
We can then run the agent with the following command:
92
91
93
92
```bash
94
-
npx @huggingface/tiny-agents run ./my-agent
93
+
npx @huggingface/tiny-agents run agent.json
95
94
```
96
95
97
96
</hfoption>
@@ -114,13 +113,11 @@ The JSON file will look like this:
114
113
"servers": [
115
114
{
116
115
"type": "stdio",
117
-
"config": {
118
-
"command": "npx",
119
-
"args": [
120
-
"mcp-remote",
121
-
"http://localhost:7860/gradio_api/mcp/sse"
122
-
]
123
-
}
116
+
"command": "npx.cmd",
117
+
"args": [
118
+
"mcp-remote",
119
+
"http://localhost:7860/gradio_api/mcp/sse"
120
+
]
124
121
}
125
122
]
126
123
}
@@ -154,13 +151,11 @@ We could also use an open source model running locally with Tiny Agents. If we s
154
151
"servers": [
155
152
{
156
153
"type": "stdio",
157
-
"config": {
158
-
"command": "npx",
159
-
"args": [
160
-
"mcp-remote",
161
-
"http://localhost:1234/v1/mcp/sse"
162
-
]
163
-
}
154
+
"command": "npx",
155
+
"args": [
156
+
"mcp-remote",
157
+
"http://localhost:1234/v1/mcp/sse"
158
+
]
164
159
}
165
160
]
166
161
}
@@ -271,4 +266,4 @@ This modular approach is what makes MCP so powerful for building flexible AI app
271
266
272
267
- Check out the Tiny Agents blog posts in [Python](https://huggingface.co/blog/python-tiny-agents) and [TypeScript](https://huggingface.co/blog/tiny-agents)
273
268
- Review the [Tiny Agents documentation](https://huggingface.co/docs/huggingface.js/main/en/tiny-agents/README)
0 commit comments