@appsai/mcp-server 1.0.7 → 1.0.9
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/README.md +6 -7
- package/dist/tools.d.ts +11 -1
- package/dist/tools.js +27 -127
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -37,18 +37,17 @@ Add to MCP settings with:
|
|
|
37
37
|
3. Click **Create API Key**
|
|
38
38
|
4. Copy the key (shown once)
|
|
39
39
|
|
|
40
|
-
## Tools (
|
|
40
|
+
## Tools (90+ Total)
|
|
41
41
|
|
|
42
42
|
| Category | Tools | Description |
|
|
43
43
|
|----------|-------|-------------|
|
|
44
44
|
| **Project** | 5 | Create, list, and manage projects |
|
|
45
45
|
| **Canvas** | 25 | Edit React components, styles, and assets |
|
|
46
|
-
| **Server** | 6 | Backend Parse Server
|
|
47
|
-
| **System** |
|
|
48
|
-
| **AWS** | 23 | CloudFormation, S3,
|
|
46
|
+
| **Server** | 6 | Backend Parse Server cloud functions |
|
|
47
|
+
| **System** | 7 | Deploy frontend/backend, connect apps |
|
|
48
|
+
| **AWS** | 23 | CloudFormation, S3, EC2, and more |
|
|
49
49
|
| **MongoDB** | 18 | Database and collection management |
|
|
50
|
-
| **
|
|
51
|
-
| **Shared** | 7 | Cross-AI communication |
|
|
50
|
+
| **Agents** | 9 | AI prompt management and versioning |
|
|
52
51
|
|
|
53
52
|
## Example Usage
|
|
54
53
|
|
|
@@ -57,7 +56,7 @@ Add to MCP settings with:
|
|
|
57
56
|
→ project_LIST_PROJECTS
|
|
58
57
|
|
|
59
58
|
"Create a new Next.js app"
|
|
60
|
-
→
|
|
59
|
+
→ project_CREATE_APP
|
|
61
60
|
|
|
62
61
|
"Show the file tree for project abc123"
|
|
63
62
|
→ canvas_LIST_FILES
|
package/dist/tools.d.ts
CHANGED
|
@@ -2,16 +2,26 @@
|
|
|
2
2
|
* MCP Tool Registry
|
|
3
3
|
*
|
|
4
4
|
* Converts OpenAI-style tool definitions to MCP format and routes tool calls.
|
|
5
|
+
* All tool definitions come from the backend - this file handles:
|
|
6
|
+
* - Converting to MCP format
|
|
7
|
+
* - Injecting projectId where needed
|
|
8
|
+
* - Routing tool calls to the backend
|
|
5
9
|
*/
|
|
6
10
|
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Tool categories matching the backend.
|
|
13
|
+
* - AI Types: canvas, server, aws, mongodb, agents
|
|
14
|
+
* - Shared Tools: project, system (available to all AIs)
|
|
15
|
+
*/
|
|
7
16
|
export type ToolCategory = 'project' | 'canvas' | 'server' | 'system' | 'aws' | 'mongodb' | 'agents';
|
|
8
17
|
/**
|
|
9
18
|
* Get all MCP tools
|
|
10
|
-
* Fetches tool definitions from
|
|
19
|
+
* Fetches tool definitions from the backend
|
|
11
20
|
*/
|
|
12
21
|
export declare function getAllTools(): Promise<Tool[]>;
|
|
13
22
|
/**
|
|
14
23
|
* Execute a tool call
|
|
24
|
+
* Routes all tools through the unified executeMCPTool backend function
|
|
15
25
|
*/
|
|
16
26
|
export declare function executeToolCall(toolName: string, args: Record<string, unknown>, userId: string): Promise<{
|
|
17
27
|
content: Array<{
|
package/dist/tools.js
CHANGED
|
@@ -2,31 +2,34 @@
|
|
|
2
2
|
* MCP Tool Registry
|
|
3
3
|
*
|
|
4
4
|
* Converts OpenAI-style tool definitions to MCP format and routes tool calls.
|
|
5
|
+
* All tool definitions come from the backend - this file handles:
|
|
6
|
+
* - Converting to MCP format
|
|
7
|
+
* - Injecting projectId where needed
|
|
8
|
+
* - Routing tool calls to the backend
|
|
5
9
|
*/
|
|
6
10
|
import { runCloudFunction } from './utils/parse.js';
|
|
7
11
|
// Categories that require projectId for execution
|
|
8
12
|
const CATEGORIES_REQUIRING_PROJECT_ID = ['canvas', 'server', 'system', 'aws', 'mongodb', 'agents'];
|
|
9
13
|
/**
|
|
10
14
|
* Convert an OpenAI-style tool to MCP format
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* Also injects projectId parameter for tools that require it.
|
|
15
|
-
* This enables connected apps - AI can target different projects.
|
|
15
|
+
* - Strips additionalProperties (Claude Code MCP bug workaround)
|
|
16
|
+
* - Injects projectId parameter for categories that require it
|
|
16
17
|
*/
|
|
17
18
|
function convertToMCPTool(tool, category) {
|
|
18
19
|
// Clone and strip additionalProperties which causes Claude Code to reject tools
|
|
20
|
+
// See: https://github.com/anthropics/claude-code/issues/2682
|
|
19
21
|
const { additionalProperties, ...cleanParams } = tool.parameters;
|
|
20
|
-
// Inject projectId for categories that require it
|
|
22
|
+
// Inject projectId for categories that require it (only if not already present)
|
|
21
23
|
if (CATEGORIES_REQUIRING_PROJECT_ID.includes(category)) {
|
|
22
|
-
cleanParams.properties
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
if (!cleanParams.properties.projectId) {
|
|
25
|
+
cleanParams.properties = {
|
|
26
|
+
projectId: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: 'The project ID to execute this tool on. Required. Use project_LIST_PROJECTS to see available projects.',
|
|
29
|
+
},
|
|
30
|
+
...cleanParams.properties,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
30
33
|
if (!cleanParams.required.includes('projectId')) {
|
|
31
34
|
cleanParams.required = ['projectId', ...cleanParams.required];
|
|
32
35
|
}
|
|
@@ -37,101 +40,12 @@ function convertToMCPTool(tool, category) {
|
|
|
37
40
|
inputSchema: cleanParams,
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
|
-
// Project management tools (new for MCP)
|
|
41
|
-
// Note: Removed additionalProperties to fix Claude Code MCP tool registration bug
|
|
42
|
-
// See: https://github.com/anthropics/claude-code/issues/2682
|
|
43
|
-
const projectTools = [
|
|
44
|
-
{
|
|
45
|
-
type: 'function',
|
|
46
|
-
name: 'LIST_PROJECTS',
|
|
47
|
-
description: 'List all projects owned by or shared with the authenticated user',
|
|
48
|
-
parameters: {
|
|
49
|
-
type: 'object',
|
|
50
|
-
properties: {
|
|
51
|
-
skip: { type: 'number', description: 'Number of projects to skip (for pagination)' },
|
|
52
|
-
limit: { type: 'number', description: 'Maximum number of projects to return (default 20)' },
|
|
53
|
-
},
|
|
54
|
-
required: [],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
type: 'function',
|
|
59
|
-
name: 'GET_TEMPLATES',
|
|
60
|
-
description: 'Get available starter templates for creating new projects',
|
|
61
|
-
parameters: {
|
|
62
|
-
type: 'object',
|
|
63
|
-
properties: {
|
|
64
|
-
_placeholder: { type: 'string', description: 'Unused parameter (no parameters required)' },
|
|
65
|
-
},
|
|
66
|
-
required: [],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
type: 'function',
|
|
71
|
-
name: 'CREATE_PROJECT',
|
|
72
|
-
description: 'Create a new project from a starter template',
|
|
73
|
-
parameters: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
properties: {
|
|
76
|
-
templateS3Key: { type: 'string', description: 'S3 key of the starter template to use' },
|
|
77
|
-
},
|
|
78
|
-
required: ['templateS3Key'],
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
type: 'function',
|
|
83
|
-
name: 'GET_PROJECT_DETAILS',
|
|
84
|
-
description: 'Get detailed information about a specific project',
|
|
85
|
-
parameters: {
|
|
86
|
-
type: 'object',
|
|
87
|
-
properties: {
|
|
88
|
-
projectId: { type: 'string', description: 'The project ID' },
|
|
89
|
-
},
|
|
90
|
-
required: ['projectId'],
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
type: 'function',
|
|
95
|
-
name: 'DELETE_PROJECT',
|
|
96
|
-
description: 'Delete a project (owner only). This action cannot be undone.',
|
|
97
|
-
parameters: {
|
|
98
|
-
type: 'object',
|
|
99
|
-
properties: {
|
|
100
|
-
projectId: { type: 'string', description: 'The project ID to delete' },
|
|
101
|
-
},
|
|
102
|
-
required: ['projectId'],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
];
|
|
106
|
-
// Map project tool names to cloud functions
|
|
107
|
-
const projectToolToCloudFunction = {
|
|
108
|
-
LIST_PROJECTS: 'getUserProjects',
|
|
109
|
-
GET_TEMPLATES: 'getTemplates',
|
|
110
|
-
CREATE_PROJECT: 'createProject',
|
|
111
|
-
GET_PROJECT_DETAILS: 'getProjectDetails',
|
|
112
|
-
DELETE_PROJECT: 'deleteProject',
|
|
113
|
-
};
|
|
114
|
-
// Map category tools to cloud functions
|
|
115
|
-
const categoryToolToCloudFunction = {
|
|
116
|
-
project: 'executeProjectTool',
|
|
117
|
-
canvas: 'executeMCPTool',
|
|
118
|
-
server: 'executeMCPTool',
|
|
119
|
-
system: 'executeMCPTool',
|
|
120
|
-
aws: 'executeMCPTool',
|
|
121
|
-
mongodb: 'executeMCPTool',
|
|
122
|
-
agents: 'executeMCPTool',
|
|
123
|
-
};
|
|
124
43
|
/**
|
|
125
44
|
* Get all MCP tools
|
|
126
|
-
* Fetches tool definitions from
|
|
45
|
+
* Fetches tool definitions from the backend
|
|
127
46
|
*/
|
|
128
47
|
export async function getAllTools() {
|
|
129
48
|
const tools = [];
|
|
130
|
-
// Add project tools (defined locally)
|
|
131
|
-
for (const tool of projectTools) {
|
|
132
|
-
tools.push(convertToMCPTool(tool, 'project'));
|
|
133
|
-
}
|
|
134
|
-
// Fetch category tools from backend
|
|
135
49
|
try {
|
|
136
50
|
const result = await runCloudFunction('getMCPToolDefinitions', {});
|
|
137
51
|
for (const [category, categoryTools] of Object.entries(result.tools)) {
|
|
@@ -142,12 +56,13 @@ export async function getAllTools() {
|
|
|
142
56
|
}
|
|
143
57
|
catch (error) {
|
|
144
58
|
console.error('[Tools] Failed to fetch tool definitions from backend:', error);
|
|
145
|
-
//
|
|
59
|
+
// No fallback - MCP server requires backend connectivity
|
|
146
60
|
}
|
|
147
61
|
return tools;
|
|
148
62
|
}
|
|
149
63
|
/**
|
|
150
64
|
* Execute a tool call
|
|
65
|
+
* Routes all tools through the unified executeMCPTool backend function
|
|
151
66
|
*/
|
|
152
67
|
export async function executeToolCall(toolName, args, userId) {
|
|
153
68
|
// Parse tool name: category_TOOL_NAME
|
|
@@ -161,27 +76,12 @@ export async function executeToolCall(toolName, args, userId) {
|
|
|
161
76
|
const category = toolName.substring(0, underscoreIndex);
|
|
162
77
|
const name = toolName.substring(underscoreIndex + 1);
|
|
163
78
|
try {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
content: [{ type: 'text', text: `Unknown project tool: ${name}` }],
|
|
171
|
-
isError: true,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
result = await runCloudFunction(cloudFunction, { ...args, _mcpUserId: userId });
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
// Handle category tools via unified MCP executor
|
|
178
|
-
result = await runCloudFunction('executeMCPTool', {
|
|
179
|
-
category,
|
|
180
|
-
tool: name,
|
|
181
|
-
params: args,
|
|
182
|
-
userId,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
79
|
+
const result = await runCloudFunction('executeMCPTool', {
|
|
80
|
+
category,
|
|
81
|
+
tool: name,
|
|
82
|
+
params: args,
|
|
83
|
+
userId,
|
|
84
|
+
});
|
|
185
85
|
return {
|
|
186
86
|
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
187
87
|
};
|
|
@@ -191,7 +91,7 @@ export async function executeToolCall(toolName, args, userId) {
|
|
|
191
91
|
const code = error?.code;
|
|
192
92
|
if (code === 402) {
|
|
193
93
|
return {
|
|
194
|
-
content: [{ type: 'text', text: 'Insufficient credits.
|
|
94
|
+
content: [{ type: 'text', text: 'Insufficient credits. Add funds at https://appsai.com/billing' }],
|
|
195
95
|
isError: true,
|
|
196
96
|
};
|
|
197
97
|
}
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAsBpD,kDAAkD;AAClD,MAAM,+BAA+B,GAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAEnH;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,IAAY,EAAE,QAAsB;IAC5D,gFAAgF;IAChF,6DAA6D;IAC7D,MAAM,EAAE,oBAAoB,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;IAEjE,gFAAgF;IAChF,IAAI,+BAA+B,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YACtC,WAAW,CAAC,UAAU,GAAG;gBACvB,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wGAAwG;iBACtH;gBACD,GAAG,WAAW,CAAC,UAAU;aAC1B,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAChD,WAAW,CAAC,QAAQ,GAAG,CAAC,WAAW,EAAE,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,GAAG,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE;QAChC,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,WAAW,EAAE,WAAkC;KAChD,CAAC;AACJ,CAA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AE;YACtD,QAAQ;YACR,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,MAAM;SACP,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACnE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,MAAM,IAAI,GAAI,KAA2B,EAAE,IAAI,CAAC;QAEhD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+DAA+D,EAAE,CAAC;gBAClG,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,QAAQ,KAAK,OAAO,EAAE,EAAE,CAAC;YAC5E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"url": "https://github.com/appsai-inc/mcp-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.8",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "@appsai/mcp-server",
|
|
15
|
-
"version": "1.0.
|
|
15
|
+
"version": "1.0.8",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
},
|