@pi-unipi/mcp 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +40 -53
  2. package/package.json +1 -1
  3. package/src/index.ts +2 -5
package/README.md CHANGED
@@ -1,32 +1,45 @@
1
1
  # @pi-unipi/mcp
2
2
 
3
- MCP (Model Context Protocol) server management extension for Pi coding agent. Browse a catalog of 7,800+ MCP servers, add them interactively, and use their tools seamlessly within pi.
3
+ Browse a catalog of 7,800+ MCP servers, add them interactively, and use their tools in Pi. MCP (Model Context Protocol) servers expose external capabilities — GitHub operations, database queries, file system access — as tools the agent can call.
4
4
 
5
- ## Features
6
-
7
- - **Browse Catalog**: Search and discover MCP servers from the awesome-mcp-servers collection
8
- - **Interactive Add**: Split-pane overlay with server browser + JSON config editor
9
- - **Settings Management**: Enable/disable, edit, delete servers with scope switching
10
- - **Config Hierarchy**: Global defaults with project-level overrides
11
- - **Auto-Discovery**: Tools from MCP servers are automatically registered as pi tools
12
- - **Offline Support**: Bundled seed catalog with 49 curated servers as fallback
5
+ The add command opens a split-pane overlay: server browser on the left, JSON config editor on the right. Pick a server, edit its config, save. Tools from added servers are automatically registered as Pi tools with the pattern `{serverName}__{toolName}`.
13
6
 
14
7
  ## Commands
15
8
 
16
9
  | Command | Description |
17
10
  |---------|-------------|
18
- | `/unipi:mcp-add` | Open browse + editor overlay to add MCP servers |
11
+ | `/unipi:mcp-add` | Open browse and editor overlay to add MCP servers |
19
12
  | `/unipi:mcp-settings` | Interactive settings with enable/disable/edit |
20
13
  | `/unipi:mcp-sync` | Force sync server catalog from GitHub |
21
14
  | `/unipi:mcp-status` | Text summary of all configured servers |
22
15
 
23
- ## Setup
16
+ ### Setup Flow
17
+
18
+ 1. Run `/unipi:mcp-add`
19
+ 2. Browse or search the server catalog
20
+ 3. Edit the config in the right pane
21
+ 4. Save and restart Pi to activate
22
+
23
+ ## Special Triggers
24
+
25
+ When MCP is installed, all workflow skills get access to MCP server tools. Tools are named `{serverName}__{toolName}` — for example, `github__search_code` or `filesystem__read_file`.
24
26
 
25
- 1. Install as part of the unipi extension suite
26
- 2. Add MCP servers via `/unipi:mcp-add` or manually edit config files
27
- 3. Restart pi to activate newly added servers
27
+ MCP registers with the info-screen dashboard, showing server count, active servers, and total tools. The footer subscribes to `MCP_SERVER_STARTED`, `MCP_SERVER_STOPPED`, and `MCP_SERVER_ERROR` events to display MCP status.
28
28
 
29
- ## Configuration
29
+ ## Agent Tools
30
+
31
+ MCP tools are registered dynamically based on configured servers. Once a server is added and Pi restarts, its tools become available to the agent.
32
+
33
+ Example tool calls:
34
+ ```
35
+ github__search_code({ query: "authentication middleware" })
36
+ github__list_pull_requests({ state: "open" })
37
+ filesystem__read_file({ path: "/home/user/config.json" })
38
+ ```
39
+
40
+ The agent doesn't need to know about MCP directly — tools appear in its tool list with the server prefix.
41
+
42
+ ## Configurables
30
43
 
31
44
  ### File Locations
32
45
 
@@ -63,47 +76,21 @@ MCP (Model Context Protocol) server management extension for Pi coding agent. Br
63
76
 
64
77
  ### Config Merge Rules
65
78
 
66
- 1. Server exists only in global loaded normally
67
- 2. Server exists only in project loaded normally
68
- 3. Server exists in both **project wins entirely**
69
- 4. `"enabled": false` in project metadata **disabled** even if defined globally
79
+ 1. Server exists only in global loaded normally
80
+ 2. Server exists only in project loaded normally
81
+ 3. Server exists in both project wins entirely
82
+ 4. `"enabled": false` in project metadata disabled even if defined globally
70
83
 
71
- ## Tool Naming
84
+ ## Troubleshooting
72
85
 
73
- MCP tools are registered with the pattern `{serverName}__{toolName}`:
74
- - `github__search_code`
75
- - `filesystem__read_file`
76
- - `brave-search__brave_web_search`
86
+ **Server won't start:** Check `/unipi:mcp-status` for errors, verify the command exists on your system.
77
87
 
78
- ## Architecture
88
+ **Tools not appearing:** Ensure the server is running and supports the MCP protocol.
79
89
 
80
- ```
81
- packages/mcp/
82
- ├── src/
83
- │ ├── index.ts # Extension entry, command registration
84
- │ ├── types.ts # TypeScript interfaces
85
- │ ├── config/
86
- │ │ ├── schema.ts # Defaults and validation
87
- │ │ ├── manager.ts # Config read/merge/write
88
- │ │ └── sync.ts # Catalog fetch and caching
89
- │ ├── bridge/
90
- │ │ ├── client.ts # MCP JSON-RPC client (stdio)
91
- │ │ ├── translator.ts # MCP tool → pi tool
92
- │ │ └── registry.ts # Server lifecycle management
93
- │ └── tui/
94
- │ ├── add-overlay.ts # /unipi:mcp-add UI
95
- │ └── settings-overlay.ts # /unipi:mcp-settings UI
96
- ├── data/
97
- │ └── seed-servers.json # Offline fallback catalog (49 servers)
98
- ├── skills/mcp/
99
- │ └── SKILL.md # Agent instructions
100
- ├── package.json
101
- └── README.md
102
- ```
90
+ **Config issues:** Validate JSON syntax and check file permissions.
103
91
 
104
- ## Troubleshooting
92
+ **Sync issues:** Run `/unipi:mcp-sync`, check network. The seed catalog (49 servers) is available offline as fallback.
93
+
94
+ ## License
105
95
 
106
- - **Server won't start**: Check `/unipi:mcp-status` for errors, verify command exists
107
- - **Tools not appearing**: Ensure server is running, check MCP protocol support
108
- - **Config issues**: Validate JSON syntax, check file permissions
109
- - **Sync issues**: Run `/unipi:mcp-sync`, check network, seed catalog available offline
96
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/mcp",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "MCP server management extension for Pi coding agent — browse, add, configure, and use MCP servers",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -333,12 +333,9 @@ export default function (pi: ExtensionAPI) {
333
333
  try {
334
334
  await reg.restartServer(state.name);
335
335
  restarted++;
336
- } catch (err) {
336
+ } catch (_err) {
337
337
  failed++;
338
- console.error(
339
- `[MCP] Failed to restart server '${state.name}':`,
340
- err instanceof Error ? err.message : err,
341
- );
338
+ // Silently ignore — restart failure tracked in failed count.
342
339
  }
343
340
  }
344
341