pi-mcp-adapter 2.0.1 → 2.1.1
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.
- package/CHANGELOG.md +11 -1
- package/README.md +62 -1
- package/config.ts +100 -3
- package/index.ts +373 -15
- package/mcp-panel.ts +713 -0
- package/package.json +2 -1
- package/types.ts +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-mcp-adapter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "MCP (Model Context Protocol) adapter extension for Pi coding agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"metadata-cache.ts",
|
|
41
41
|
"npx-resolver.ts",
|
|
42
42
|
"oauth-handler.ts",
|
|
43
|
+
"mcp-panel.ts",
|
|
43
44
|
"README.md",
|
|
44
45
|
"CHANGELOG.md",
|
|
45
46
|
"ARCHITECTURE.md",
|
package/types.ts
CHANGED
|
@@ -70,6 +70,8 @@ export interface ServerEntry {
|
|
|
70
70
|
idleTimeout?: number; // minutes, overrides global setting
|
|
71
71
|
// Resource handling
|
|
72
72
|
exposeResources?: boolean;
|
|
73
|
+
// Direct tool registration
|
|
74
|
+
directTools?: boolean | string[];
|
|
73
75
|
// Debug
|
|
74
76
|
debug?: boolean; // Show server stderr (default: false)
|
|
75
77
|
}
|
|
@@ -78,6 +80,7 @@ export interface ServerEntry {
|
|
|
78
80
|
export interface McpSettings {
|
|
79
81
|
toolPrefix?: "server" | "none" | "short";
|
|
80
82
|
idleTimeout?: number; // minutes, default 10, 0 to disable
|
|
83
|
+
directTools?: boolean;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
// Root config
|
|
@@ -98,6 +101,32 @@ export interface ToolMetadata {
|
|
|
98
101
|
inputSchema?: unknown; // JSON Schema for parameters (stored for describe/errors)
|
|
99
102
|
}
|
|
100
103
|
|
|
104
|
+
export interface DirectToolSpec {
|
|
105
|
+
serverName: string;
|
|
106
|
+
originalName: string;
|
|
107
|
+
prefixedName: string;
|
|
108
|
+
description: string;
|
|
109
|
+
inputSchema?: unknown;
|
|
110
|
+
resourceUri?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ServerProvenance {
|
|
114
|
+
path: string;
|
|
115
|
+
kind: "user" | "project" | "import";
|
|
116
|
+
importKind?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface McpPanelCallbacks {
|
|
120
|
+
reconnect: (serverName: string) => Promise<boolean>;
|
|
121
|
+
getConnectionStatus: (serverName: string) => "connected" | "idle" | "failed" | "needs-auth";
|
|
122
|
+
refreshCacheAfterReconnect: (serverName: string) => import("./metadata-cache.js").ServerCacheEntry | null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface McpPanelResult {
|
|
126
|
+
changes: Map<string, true | string[] | false>;
|
|
127
|
+
cancelled: boolean;
|
|
128
|
+
}
|
|
129
|
+
|
|
101
130
|
/**
|
|
102
131
|
* Get server prefix based on tool prefix mode.
|
|
103
132
|
*/
|