@withone/mcp 1.0.0
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/LICENSE +21 -0
- package/README.md +172 -0
- package/build/client.d.ts +102 -0
- package/build/client.js +362 -0
- package/build/helpers.d.ts +53 -0
- package/build/helpers.js +150 -0
- package/build/index.d.ts +10 -0
- package/build/index.js +281 -0
- package/build/schemas.d.ts +285 -0
- package/build/schemas.js +110 -0
- package/build/server.d.ts +27 -0
- package/build/server.js +215 -0
- package/build/types.d.ts +182 -0
- package/build/types.js +9 -0
- package/package.json +47 -0
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the Pica MCP Server
|
|
3
|
+
*
|
|
4
|
+
* This file contains all TypeScript interfaces and types used throughout the application.
|
|
5
|
+
*
|
|
6
|
+
* @fileoverview Core type definitions for Pica API integration
|
|
7
|
+
* @author Pica
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* API response structure for paginated endpoints
|
|
11
|
+
*/
|
|
12
|
+
export interface PaginatedResponse<T> {
|
|
13
|
+
rows: T[];
|
|
14
|
+
total: number;
|
|
15
|
+
skip: number;
|
|
16
|
+
limit: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Definition of an available platform/connector that users can connect to
|
|
20
|
+
*/
|
|
21
|
+
export interface ConnectionDefinition {
|
|
22
|
+
name: string;
|
|
23
|
+
key: string;
|
|
24
|
+
platform: string;
|
|
25
|
+
platformVersion: string;
|
|
26
|
+
description: string;
|
|
27
|
+
category: string;
|
|
28
|
+
image: string;
|
|
29
|
+
tags: string[];
|
|
30
|
+
oauth: boolean;
|
|
31
|
+
createdAt: number;
|
|
32
|
+
updatedAt: number;
|
|
33
|
+
version: string;
|
|
34
|
+
active: boolean;
|
|
35
|
+
deprecated: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Represents an active user connection to a platform
|
|
39
|
+
*/
|
|
40
|
+
export interface Connection {
|
|
41
|
+
key: string;
|
|
42
|
+
platform: string;
|
|
43
|
+
tags: string[];
|
|
44
|
+
active: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Available action from search endpoint (uses systemId)
|
|
48
|
+
*/
|
|
49
|
+
export interface AvailableAction {
|
|
50
|
+
systemId: string;
|
|
51
|
+
title: string;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
knowledge?: string;
|
|
54
|
+
path: string;
|
|
55
|
+
method: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Action details from knowledge endpoint (uses _id)
|
|
59
|
+
*/
|
|
60
|
+
export interface ActionDetails {
|
|
61
|
+
_id: string;
|
|
62
|
+
title: string;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
knowledge?: string;
|
|
65
|
+
path: string;
|
|
66
|
+
method: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Arguments for list_pica_integrations tool
|
|
70
|
+
*/
|
|
71
|
+
export interface ListPicaIntegrationsArgs {
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Arguments for search_pica_platform_actions tool
|
|
75
|
+
*/
|
|
76
|
+
export interface SearchPicaPlatformActionsArgs {
|
|
77
|
+
platform: string;
|
|
78
|
+
query: string;
|
|
79
|
+
agentType?: "execute" | "knowledge";
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Arguments for get_pica_action_knowledge tool
|
|
83
|
+
*/
|
|
84
|
+
export interface GetPicaActionKnowledgeArgs {
|
|
85
|
+
actionId: string;
|
|
86
|
+
platform: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Response for get_pica_action_knowledge tool
|
|
90
|
+
*/
|
|
91
|
+
export interface GetPicaActionKnowledgeResponse {
|
|
92
|
+
knowledge: string;
|
|
93
|
+
method: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Action object structure for create_pica_request tool
|
|
97
|
+
*/
|
|
98
|
+
export interface ActionObject {
|
|
99
|
+
_id: string;
|
|
100
|
+
path: string;
|
|
101
|
+
method: string;
|
|
102
|
+
tags?: string[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Arguments for create_pica_request tool
|
|
106
|
+
*/
|
|
107
|
+
export interface ExecutePicaActionArgs {
|
|
108
|
+
platform: string;
|
|
109
|
+
actionId: string;
|
|
110
|
+
connectionKey: string;
|
|
111
|
+
data?: any;
|
|
112
|
+
pathVariables?: Record<string, string | number | boolean>;
|
|
113
|
+
queryParams?: Record<string, any>;
|
|
114
|
+
headers?: Record<string, any>;
|
|
115
|
+
isFormData?: boolean;
|
|
116
|
+
isFormUrlEncoded?: boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* HTTP request configuration for axios
|
|
120
|
+
*/
|
|
121
|
+
export interface RequestConfig {
|
|
122
|
+
url: string;
|
|
123
|
+
method: string;
|
|
124
|
+
headers: Record<string, string>;
|
|
125
|
+
params?: Record<string, string>;
|
|
126
|
+
data?: unknown;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Sanitized version of request config with sensitive data redacted
|
|
130
|
+
*/
|
|
131
|
+
export interface SanitizedRequestConfig {
|
|
132
|
+
url: string;
|
|
133
|
+
method: string;
|
|
134
|
+
headers: Record<string, string>;
|
|
135
|
+
params?: Record<string, string>;
|
|
136
|
+
data?: unknown;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Response from executePassthroughRequest
|
|
140
|
+
*/
|
|
141
|
+
export interface ExecutePassthroughResponse {
|
|
142
|
+
requestConfig: SanitizedRequestConfig;
|
|
143
|
+
responseData: unknown;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Structured response for list_pica_integrations tool
|
|
147
|
+
*/
|
|
148
|
+
export interface ListIntegrationsResponse {
|
|
149
|
+
[x: string]: unknown;
|
|
150
|
+
connections: Array<{
|
|
151
|
+
platform: string;
|
|
152
|
+
key: string;
|
|
153
|
+
tags: string[];
|
|
154
|
+
}>;
|
|
155
|
+
availablePlatforms: Array<{
|
|
156
|
+
platform: string;
|
|
157
|
+
name: string;
|
|
158
|
+
category: string;
|
|
159
|
+
}>;
|
|
160
|
+
summary: {
|
|
161
|
+
connectedCount: number;
|
|
162
|
+
availableCount: number;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Structured response for search_pica_platform_actions tool
|
|
167
|
+
*/
|
|
168
|
+
export interface SearchActionsResponse {
|
|
169
|
+
[x: string]: unknown;
|
|
170
|
+
actions: Array<{
|
|
171
|
+
actionId: string;
|
|
172
|
+
title: string;
|
|
173
|
+
method: string;
|
|
174
|
+
path: string;
|
|
175
|
+
}>;
|
|
176
|
+
metadata: {
|
|
177
|
+
platform: string;
|
|
178
|
+
query: string;
|
|
179
|
+
count: number;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export type PermissionLevel = "read" | "write" | "admin";
|
package/build/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@withone/mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A Model Context Protocol Server for One",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mcp": "./build/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"build"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
|
|
14
|
+
"prepare": "npm run build",
|
|
15
|
+
"watch": "tsc --watch",
|
|
16
|
+
"inspector": "npx @modelcontextprotocol/inspector build/index.js",
|
|
17
|
+
"http": "npm run build && node build/index.js",
|
|
18
|
+
"http:dev": "npm run build && nodemon build/index.js"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
22
|
+
"@vercel/mcp-adapter": "^0.9.1",
|
|
23
|
+
"axios": "^1.10.0",
|
|
24
|
+
"cors": "^2.8.5",
|
|
25
|
+
"express": "^5.1.0",
|
|
26
|
+
"form-data": "^4.0.3",
|
|
27
|
+
"zod": "^3.23.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/cors": "^2.8.19",
|
|
31
|
+
"@types/express": "^5.0.3",
|
|
32
|
+
"@types/node": "^22.0.0",
|
|
33
|
+
"nodemon": "^3.1.10",
|
|
34
|
+
"typescript": "^5.6.0"
|
|
35
|
+
},
|
|
36
|
+
"author": {
|
|
37
|
+
"name": "One",
|
|
38
|
+
"email": "support@withone.ai",
|
|
39
|
+
"url": "https://withone.ai"
|
|
40
|
+
},
|
|
41
|
+
"license": "GPL-3.0",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/withoneai/mcp"
|
|
45
|
+
},
|
|
46
|
+
"mcpName": "withone.ai/mcp"
|
|
47
|
+
}
|