@pantheon.ai/mcp 0.0.5 → 0.0.7
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/dist/cli.js +15 -15
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -854,7 +854,7 @@ function getServerErrorMessage(error) {
|
|
|
854
854
|
|
|
855
855
|
//#endregion
|
|
856
856
|
//#region package.json
|
|
857
|
-
var version = "0.0.
|
|
857
|
+
var version = "0.0.7";
|
|
858
858
|
|
|
859
859
|
//#endregion
|
|
860
860
|
//#region src/mcp/mcp.ts
|
|
@@ -873,14 +873,14 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
873
873
|
name: "Pantheon MCP",
|
|
874
874
|
version,
|
|
875
875
|
websiteUrl: "https://pantheon-ai.tidb.ai/"
|
|
876
|
-
});
|
|
876
|
+
}, { instructions: "Use tools to accept pantheon data." });
|
|
877
877
|
function registerApiTool(name, api, { paramsSchema, bodySchema, ...options }) {
|
|
878
|
+
const inputSchemaShape = {};
|
|
879
|
+
if (paramsSchema) inputSchemaShape.params = paramsSchema;
|
|
880
|
+
if (bodySchema) inputSchemaShape.body = bodySchema;
|
|
878
881
|
mcpServer.registerTool(name, {
|
|
879
882
|
...options,
|
|
880
|
-
inputSchema: z.object(
|
|
881
|
-
params: paramsSchema,
|
|
882
|
-
body: bodySchema
|
|
883
|
-
})
|
|
883
|
+
inputSchema: z.object(inputSchemaShape)
|
|
884
884
|
}, async ({ params, body }) => {
|
|
885
885
|
try {
|
|
886
886
|
const result = await executor.execute(api, params, body);
|
|
@@ -902,12 +902,12 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
902
902
|
registerApiTool("listProjects", listProjects, {
|
|
903
903
|
title: "List pantheon projects",
|
|
904
904
|
paramsSchema: pageParams,
|
|
905
|
-
bodySchema:
|
|
905
|
+
bodySchema: null,
|
|
906
906
|
outputSchema: paged(projectSchema)
|
|
907
907
|
});
|
|
908
908
|
registerApiTool("createProject", createProject, {
|
|
909
909
|
title: "Create pantheon project",
|
|
910
|
-
paramsSchema:
|
|
910
|
+
paramsSchema: null,
|
|
911
911
|
bodySchema: z.object({
|
|
912
912
|
first_prompt: z.string(),
|
|
913
913
|
project_type: z.enum(["general", "github"]),
|
|
@@ -920,13 +920,13 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
920
920
|
registerApiTool("listProjectBranches", listProjectBranches, {
|
|
921
921
|
title: "List project branches",
|
|
922
922
|
paramsSchema: pageParams.extend({ projectId: z.string() }),
|
|
923
|
-
bodySchema:
|
|
923
|
+
bodySchema: null,
|
|
924
924
|
outputSchema: paged(branchSchema)
|
|
925
925
|
});
|
|
926
926
|
registerApiTool("getProject", getProject, {
|
|
927
927
|
title: "Get pantheon project",
|
|
928
928
|
paramsSchema: z.object({ projectId: z.string() }),
|
|
929
|
-
bodySchema:
|
|
929
|
+
bodySchema: null,
|
|
930
930
|
outputSchema: projectSchema
|
|
931
931
|
});
|
|
932
932
|
registerApiTool("getProjectBranch", getProjectBranch, {
|
|
@@ -935,7 +935,7 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
935
935
|
projectId: z.string(),
|
|
936
936
|
branchId: z.string()
|
|
937
937
|
}),
|
|
938
|
-
bodySchema:
|
|
938
|
+
bodySchema: null,
|
|
939
939
|
outputSchema: branchSchema
|
|
940
940
|
});
|
|
941
941
|
registerApiTool("getProjectBranchOutput", getProjectBranchOutput, {
|
|
@@ -945,7 +945,7 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
945
945
|
branchId: z.string(),
|
|
946
946
|
fullOutput: z.boolean().optional().default(false)
|
|
947
947
|
}),
|
|
948
|
-
bodySchema:
|
|
948
|
+
bodySchema: null,
|
|
949
949
|
outputSchema: z.string()
|
|
950
950
|
});
|
|
951
951
|
registerApiTool("createProjectExploration", createProjectExploration, {
|
|
@@ -962,7 +962,7 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
962
962
|
registerApiTool("listProjectExplorations", listProjectExplorations, {
|
|
963
963
|
title: "List project explorations",
|
|
964
964
|
paramsSchema: z.object({ projectId: z.string() }),
|
|
965
|
-
bodySchema:
|
|
965
|
+
bodySchema: null,
|
|
966
966
|
outputSchema: explorationSchema.array()
|
|
967
967
|
});
|
|
968
968
|
registerApiTool("getProjectExplorationResult", getProjectExplorationResult, {
|
|
@@ -971,7 +971,7 @@ async function mcpServer({ authorizationHeader }) {
|
|
|
971
971
|
projectId: z.string(),
|
|
972
972
|
explorationId: z.string()
|
|
973
973
|
}),
|
|
974
|
-
bodySchema:
|
|
974
|
+
bodySchema: null,
|
|
975
975
|
outputSchema: explorationResultSchema
|
|
976
976
|
});
|
|
977
977
|
return mcpServer;
|
|
@@ -992,7 +992,7 @@ async function startStdio({ apiKey }) {
|
|
|
992
992
|
//#region src/streamableHttp.ts
|
|
993
993
|
const port = process.env.PORT ? parseInt(process.env.PORT) : 9986;
|
|
994
994
|
async function startStreamableHttpServer({ apiKey }) {
|
|
995
|
-
const app = createMcpExpressApp({ allowedHosts: ["pantheon-ai.tidb.ai"] });
|
|
995
|
+
const app = createMcpExpressApp({ allowedHosts: ["pantheon-ai.tidb.ai", "localhost"] });
|
|
996
996
|
app.all("/mcp", async (req, res) => {
|
|
997
997
|
const authorizationHeader = req.get("authorization") ?? (apiKey ? `Bearer ${apiKey}` : void 0);
|
|
998
998
|
let server;
|