@pantheon.ai/mcp 0.0.4 → 0.0.6

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 (2) hide show
  1. package/dist/cli.js +14 -15
  2. 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.3";
857
+ var version = "0.0.5";
858
858
 
859
859
  //#endregion
860
860
  //#region src/mcp/mcp.ts
@@ -873,14 +873,13 @@ 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 = { params: paramsSchema };
879
+ if (bodySchema) inputSchemaShape.body = bodySchema;
878
880
  mcpServer.registerTool(name, {
879
881
  ...options,
880
- inputSchema: z.object({
881
- params: paramsSchema,
882
- body: bodySchema
883
- })
882
+ inputSchema: z.object(inputSchemaShape)
884
883
  }, async ({ params, body }) => {
885
884
  try {
886
885
  const result = await executor.execute(api, params, body);
@@ -902,7 +901,7 @@ async function mcpServer({ authorizationHeader }) {
902
901
  registerApiTool("listProjects", listProjects, {
903
902
  title: "List pantheon projects",
904
903
  paramsSchema: pageParams,
905
- bodySchema: z.null(),
904
+ bodySchema: null,
906
905
  outputSchema: paged(projectSchema)
907
906
  });
908
907
  registerApiTool("createProject", createProject, {
@@ -920,13 +919,13 @@ async function mcpServer({ authorizationHeader }) {
920
919
  registerApiTool("listProjectBranches", listProjectBranches, {
921
920
  title: "List project branches",
922
921
  paramsSchema: pageParams.extend({ projectId: z.string() }),
923
- bodySchema: z.null(),
922
+ bodySchema: null,
924
923
  outputSchema: paged(branchSchema)
925
924
  });
926
925
  registerApiTool("getProject", getProject, {
927
926
  title: "Get pantheon project",
928
927
  paramsSchema: z.object({ projectId: z.string() }),
929
- bodySchema: z.null(),
928
+ bodySchema: null,
930
929
  outputSchema: projectSchema
931
930
  });
932
931
  registerApiTool("getProjectBranch", getProjectBranch, {
@@ -935,7 +934,7 @@ async function mcpServer({ authorizationHeader }) {
935
934
  projectId: z.string(),
936
935
  branchId: z.string()
937
936
  }),
938
- bodySchema: z.null(),
937
+ bodySchema: null,
939
938
  outputSchema: branchSchema
940
939
  });
941
940
  registerApiTool("getProjectBranchOutput", getProjectBranchOutput, {
@@ -945,7 +944,7 @@ async function mcpServer({ authorizationHeader }) {
945
944
  branchId: z.string(),
946
945
  fullOutput: z.boolean().optional().default(false)
947
946
  }),
948
- bodySchema: z.null(),
947
+ bodySchema: null,
949
948
  outputSchema: z.string()
950
949
  });
951
950
  registerApiTool("createProjectExploration", createProjectExploration, {
@@ -962,7 +961,7 @@ async function mcpServer({ authorizationHeader }) {
962
961
  registerApiTool("listProjectExplorations", listProjectExplorations, {
963
962
  title: "List project explorations",
964
963
  paramsSchema: z.object({ projectId: z.string() }),
965
- bodySchema: z.null(),
964
+ bodySchema: null,
966
965
  outputSchema: explorationSchema.array()
967
966
  });
968
967
  registerApiTool("getProjectExplorationResult", getProjectExplorationResult, {
@@ -971,7 +970,7 @@ async function mcpServer({ authorizationHeader }) {
971
970
  projectId: z.string(),
972
971
  explorationId: z.string()
973
972
  }),
974
- bodySchema: z.null(),
973
+ bodySchema: null,
975
974
  outputSchema: explorationResultSchema
976
975
  });
977
976
  return mcpServer;
@@ -992,7 +991,7 @@ async function startStdio({ apiKey }) {
992
991
  //#region src/streamableHttp.ts
993
992
  const port = process.env.PORT ? parseInt(process.env.PORT) : 9986;
994
993
  async function startStreamableHttpServer({ apiKey }) {
995
- const app = createMcpExpressApp();
994
+ const app = createMcpExpressApp({ allowedHosts: ["pantheon-ai.tidb.ai", "localhost"] });
996
995
  app.all("/mcp", async (req, res) => {
997
996
  const authorizationHeader = req.get("authorization") ?? (apiKey ? `Bearer ${apiKey}` : void 0);
998
997
  let server;
@@ -1031,7 +1030,7 @@ async function startStreamableHttpServer({ apiKey }) {
1031
1030
  }
1032
1031
  });
1033
1032
  app.listen(port);
1034
- console.log("Listening on port 3001");
1033
+ console.log(`Listening on port ${port}`);
1035
1034
  }
1036
1035
 
1037
1036
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pantheon.ai/mcp",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "bin": "dist/cli.js",