Skip to content

Commit 803888d

Browse files
committed
Add examples/mcp/ with launcher and Claude Desktop sample config
Three-variant Claude Desktop config (console script, python -m, standalone script) plus run_mcp.py launcher and a setup README. Gives users a ready-to-copy starting point for registering the automation_file MCP server with any MCP host.
1 parent 458d90c commit 803888d

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

examples/mcp/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# automation_file MCP server
2+
3+
Three ways to launch the MCP stdio bridge, in order of preference:
4+
5+
```bash
6+
automation_file_mcp # installed console script
7+
python -m automation_file mcp # CLI subcommand
8+
python examples/mcp/run_mcp.py # standalone launcher
9+
```
10+
11+
All three accept the same flags:
12+
13+
| Flag | Default | Description |
14+
|----------------------|--------------------|------------------------------------------------|
15+
| `--name` | `automation_file` | `serverInfo.name` returned at handshake |
16+
| `--version` | `1.0.0` | `serverInfo.version` returned at handshake |
17+
| `--allowed-actions` | *(all)* | Comma-separated allow list (e.g. `FA_file_checksum,FA_fast_find`) |
18+
19+
## Claude Desktop
20+
21+
Edit `claude_desktop_config.json`:
22+
23+
- **Windows**`%APPDATA%\Claude\claude_desktop_config.json`
24+
- **macOS**`~/Library/Application Support/Claude/claude_desktop_config.json`
25+
26+
`claude_desktop_config.json` in this directory is a ready-to-copy sample
27+
covering the three launch styles. Pick the one that matches your install.
28+
29+
## Manual smoke test
30+
31+
```bash
32+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | automation_file_mcp
33+
```
34+
35+
A single line reply containing `serverInfo` means the server is healthy.
36+
37+
## Security
38+
39+
`--allowed-actions` is strongly recommended. The default registry includes
40+
`FA_run_shell`, `FA_encrypt_file`, and other high-privilege actions that an
41+
MCP host may invoke without prompting.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"mcpServers": {
3+
"automation_file": {
4+
"command": "automation_file_mcp",
5+
"args": [
6+
"--allowed-actions",
7+
"FA_file_checksum,FA_verify_checksum,FA_fast_find,FA_sync_dir"
8+
]
9+
},
10+
"automation_file_full": {
11+
"command": "python",
12+
"args": [
13+
"-m",
14+
"automation_file",
15+
"mcp"
16+
],
17+
"env": {
18+
"PYTHONIOENCODING": "utf-8"
19+
}
20+
},
21+
"automation_file_script": {
22+
"command": "python",
23+
"args": [
24+
"C:/absolute/path/to/examples/mcp/run_mcp.py"
25+
]
26+
}
27+
}
28+
}

examples/mcp/run_mcp.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Minimal MCP stdio launcher.
2+
3+
Point an MCP host at this file with::
4+
5+
{
6+
"mcpServers": {
7+
"automation_file": {
8+
"command": "python",
9+
"args": ["/absolute/path/to/examples/mcp/run_mcp.py"]
10+
}
11+
}
12+
}
13+
14+
For a whitelisted registry prefer the installed console script
15+
``automation_file_mcp --allowed-actions FA_list_dir,FA_file_checksum`` or
16+
``python -m automation_file mcp --allowed-actions ...``.
17+
"""
18+
19+
from __future__ import annotations
20+
21+
import sys
22+
23+
from automation_file.server.mcp_server import _cli
24+
25+
26+
if __name__ == "__main__":
27+
sys.exit(_cli())

0 commit comments

Comments
 (0)