Skip to content

Commit 193ed13

Browse files
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.
1 parent 2ce8294 commit 193ed13

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

units/en/unit2/tiny-agents.mdx

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Let's setup a project with a basic Tiny Agent.
6565
```bash
6666
mkdir my-agent
6767
touch my-agent/agent.json
68+
cd my-agent
6869
```
6970

7071
The JSON file will look like this:
@@ -76,13 +77,11 @@ The JSON file will look like this:
7677
"servers": [
7778
{
7879
"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+
]
8685
}
8786
]
8887
}
@@ -91,7 +90,7 @@ The JSON file will look like this:
9190
We can then run the agent with the following command:
9291

9392
```bash
94-
npx @huggingface/tiny-agents run ./my-agent
93+
npx @huggingface/tiny-agents run agent.json
9594
```
9695

9796
</hfoption>
@@ -114,13 +113,11 @@ The JSON file will look like this:
114113
"servers": [
115114
{
116115
"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+
]
124121
}
125122
]
126123
}
@@ -154,13 +151,11 @@ We could also use an open source model running locally with Tiny Agents. If we s
154151
"servers": [
155152
{
156153
"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+
]
164159
}
165160
]
166161
}
@@ -271,4 +266,4 @@ This modular approach is what makes MCP so powerful for building flexible AI app
271266

272267
- Check out the Tiny Agents blog posts in [Python](https://huggingface.co/blog/python-tiny-agents) and [TypeScript](https://huggingface.co/blog/tiny-agents)
273268
- Review the [Tiny Agents documentation](https://huggingface.co/docs/huggingface.js/main/en/tiny-agents/README)
274-
- Build something with Tiny Agents!
269+
- Build something with Tiny Agents!

0 commit comments

Comments
 (0)