From bd991b5848806f996d493dcdca9b139fd21fe393 Mon Sep 17 00:00:00 2001 From: OpenMCP Bot <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 17:22:33 +0100 Subject: [PATCH] Add _api_v3 module --- servers/_api_v3/.npmignore | 4 + servers/_api_v3/README.md | 327 ++++++++++++++++++ servers/_api_v3/package.json | 36 ++ servers/_api_v3/src/constants.ts | 24 ++ servers/_api_v3/src/index.ts | 28 ++ servers/_api_v3/src/server.ts | 33 ++ servers/_api_v3/src/tools/addpet/index.ts | 31 ++ .../schema-json/properties/category.json | 17 + .../src/tools/addpet/schema-json/root.json | 65 ++++ .../addpet/schema/properties/category.ts | 6 + .../_api_v3/src/tools/addpet/schema/root.ts | 10 + servers/_api_v3/src/tools/createuser/index.ts | 26 ++ .../tools/createuser/schema-json/root.json | 41 +++ .../src/tools/createuser/schema/root.ts | 12 + .../tools/createuserswithlistinput/index.ts | 15 + .../schema-json/root.json | 5 + .../createuserswithlistinput/schema/root.ts | 3 + .../_api_v3/src/tools/deleteorder/index.ts | 19 + .../tools/deleteorder/schema-json/root.json | 13 + .../src/tools/deleteorder/schema/root.ts | 5 + servers/_api_v3/src/tools/deletepet/index.ts | 29 ++ .../src/tools/deletepet/schema-json/root.json | 17 + .../src/tools/deletepet/schema/root.ts | 6 + servers/_api_v3/src/tools/deleteuser/index.ts | 19 + .../tools/deleteuser/schema-json/root.json | 12 + .../src/tools/deleteuser/schema/root.ts | 5 + .../src/tools/findpetsbystatus/index.ts | 26 ++ .../findpetsbystatus/schema-json/root.json | 18 + .../src/tools/findpetsbystatus/schema/root.ts | 5 + .../_api_v3/src/tools/findpetsbytags/index.ts | 26 ++ .../findpetsbytags/schema-json/root.json | 15 + .../src/tools/findpetsbytags/schema/root.ts | 5 + .../_api_v3/src/tools/getinventory/index.ts | 22 ++ .../tools/getinventory/schema-json/root.json | 5 + .../src/tools/getinventory/schema/root.ts | 3 + .../_api_v3/src/tools/getorderbyid/index.ts | 19 + .../tools/getorderbyid/schema-json/root.json | 13 + .../src/tools/getorderbyid/schema/root.ts | 5 + servers/_api_v3/src/tools/getpetbyid/index.ts | 32 ++ .../tools/getpetbyid/schema-json/root.json | 13 + .../src/tools/getpetbyid/schema/root.ts | 5 + .../_api_v3/src/tools/getuserbyname/index.ts | 19 + .../tools/getuserbyname/schema-json/root.json | 12 + .../src/tools/getuserbyname/schema/root.ts | 5 + servers/_api_v3/src/tools/loginuser/index.ts | 20 ++ .../src/tools/loginuser/schema-json/root.json | 14 + .../src/tools/loginuser/schema/root.ts | 6 + servers/_api_v3/src/tools/logoutuser/index.ts | 15 + .../tools/logoutuser/schema-json/root.json | 5 + .../src/tools/logoutuser/schema/root.ts | 3 + servers/_api_v3/src/tools/placeorder/index.ts | 24 ++ .../tools/placeorder/schema-json/root.json | 38 ++ .../src/tools/placeorder/schema/root.ts | 10 + servers/_api_v3/src/tools/updatepet/index.ts | 31 ++ .../schema-json/properties/category.json | 17 + .../src/tools/updatepet/schema-json/root.json | 65 ++++ .../updatepet/schema/properties/category.ts | 6 + .../src/tools/updatepet/schema/root.ts | 10 + .../src/tools/updatepetwithform/index.ts | 30 ++ .../updatepetwithform/schema-json/root.json | 21 ++ .../tools/updatepetwithform/schema/root.ts | 7 + servers/_api_v3/src/tools/updateuser/index.ts | 29 ++ .../tools/updateuser/schema-json/root.json | 47 +++ .../src/tools/updateuser/schema/root.ts | 13 + servers/_api_v3/src/tools/uploadfile/index.ts | 29 ++ .../tools/uploadfile/schema-json/root.json | 17 + .../src/tools/uploadfile/schema/root.ts | 6 + servers/_api_v3/tsconfig.json | 16 + 68 files changed, 1535 insertions(+) create mode 100644 servers/_api_v3/.npmignore create mode 100644 servers/_api_v3/README.md create mode 100644 servers/_api_v3/package.json create mode 100644 servers/_api_v3/src/constants.ts create mode 100644 servers/_api_v3/src/index.ts create mode 100644 servers/_api_v3/src/server.ts create mode 100644 servers/_api_v3/src/tools/addpet/index.ts create mode 100644 servers/_api_v3/src/tools/addpet/schema-json/properties/category.json create mode 100644 servers/_api_v3/src/tools/addpet/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/addpet/schema/properties/category.ts create mode 100644 servers/_api_v3/src/tools/addpet/schema/root.ts create mode 100644 servers/_api_v3/src/tools/createuser/index.ts create mode 100644 servers/_api_v3/src/tools/createuser/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/createuser/schema/root.ts create mode 100644 servers/_api_v3/src/tools/createuserswithlistinput/index.ts create mode 100644 servers/_api_v3/src/tools/createuserswithlistinput/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/createuserswithlistinput/schema/root.ts create mode 100644 servers/_api_v3/src/tools/deleteorder/index.ts create mode 100644 servers/_api_v3/src/tools/deleteorder/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/deleteorder/schema/root.ts create mode 100644 servers/_api_v3/src/tools/deletepet/index.ts create mode 100644 servers/_api_v3/src/tools/deletepet/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/deletepet/schema/root.ts create mode 100644 servers/_api_v3/src/tools/deleteuser/index.ts create mode 100644 servers/_api_v3/src/tools/deleteuser/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/deleteuser/schema/root.ts create mode 100644 servers/_api_v3/src/tools/findpetsbystatus/index.ts create mode 100644 servers/_api_v3/src/tools/findpetsbystatus/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/findpetsbystatus/schema/root.ts create mode 100644 servers/_api_v3/src/tools/findpetsbytags/index.ts create mode 100644 servers/_api_v3/src/tools/findpetsbytags/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/findpetsbytags/schema/root.ts create mode 100644 servers/_api_v3/src/tools/getinventory/index.ts create mode 100644 servers/_api_v3/src/tools/getinventory/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/getinventory/schema/root.ts create mode 100644 servers/_api_v3/src/tools/getorderbyid/index.ts create mode 100644 servers/_api_v3/src/tools/getorderbyid/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/getorderbyid/schema/root.ts create mode 100644 servers/_api_v3/src/tools/getpetbyid/index.ts create mode 100644 servers/_api_v3/src/tools/getpetbyid/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/getpetbyid/schema/root.ts create mode 100644 servers/_api_v3/src/tools/getuserbyname/index.ts create mode 100644 servers/_api_v3/src/tools/getuserbyname/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/getuserbyname/schema/root.ts create mode 100644 servers/_api_v3/src/tools/loginuser/index.ts create mode 100644 servers/_api_v3/src/tools/loginuser/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/loginuser/schema/root.ts create mode 100644 servers/_api_v3/src/tools/logoutuser/index.ts create mode 100644 servers/_api_v3/src/tools/logoutuser/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/logoutuser/schema/root.ts create mode 100644 servers/_api_v3/src/tools/placeorder/index.ts create mode 100644 servers/_api_v3/src/tools/placeorder/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/placeorder/schema/root.ts create mode 100644 servers/_api_v3/src/tools/updatepet/index.ts create mode 100644 servers/_api_v3/src/tools/updatepet/schema-json/properties/category.json create mode 100644 servers/_api_v3/src/tools/updatepet/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/updatepet/schema/properties/category.ts create mode 100644 servers/_api_v3/src/tools/updatepet/schema/root.ts create mode 100644 servers/_api_v3/src/tools/updatepetwithform/index.ts create mode 100644 servers/_api_v3/src/tools/updatepetwithform/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/updatepetwithform/schema/root.ts create mode 100644 servers/_api_v3/src/tools/updateuser/index.ts create mode 100644 servers/_api_v3/src/tools/updateuser/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/updateuser/schema/root.ts create mode 100644 servers/_api_v3/src/tools/uploadfile/index.ts create mode 100644 servers/_api_v3/src/tools/uploadfile/schema-json/root.json create mode 100644 servers/_api_v3/src/tools/uploadfile/schema/root.ts create mode 100644 servers/_api_v3/tsconfig.json diff --git a/servers/_api_v3/.npmignore b/servers/_api_v3/.npmignore new file mode 100644 index 0000000000..c4dd0ca3c0 --- /dev/null +++ b/servers/_api_v3/.npmignore @@ -0,0 +1,4 @@ +src/ +node_modules/ +.gitignore +tsconfig.json \ No newline at end of file diff --git a/servers/_api_v3/README.md b/servers/_api_v3/README.md new file mode 100644 index 0000000000..2ba551466d --- /dev/null +++ b/servers/_api_v3/README.md @@ -0,0 +1,327 @@ +# @open-mcp/_api_v3 + +## Using the remote server + +To use the hosted Streamable HTTP server, add the following to your client config: + +```json +{ + "mcpServers": { + "_api_v3": { + "transport": "streamableHttp", + "url": "https://mcp.open-mcp.org/api/server/_api_v3@latest/mcp" + } + } +} +``` + +#### Forwarding variables + +You can forward "environment" variables to the remote server by including them in the request headers or URL query string (headers take precedence). Just prefix the variable name with `FORWARD_VAR_` like so: + +```ini +https://mcp.open-mcp.org/api/server/_api_v3@latest/mcp?FORWARD_VAR_OPEN_MCP_BASE_URL=https%3A%2F%2Fapi.example.com +``` + + + Sending authentication tokens as forwarded variables is not recommended + + +## Installing locally + +If you want to run the server locally on your own machine instead of using the remote server, first set the environment variables as shell variables: + +```bash +OAUTH2_TOKEN='...' +API_KEY='...' +``` + +Then use the OpenMCP config CLI to add the server to your MCP client: + +### Claude desktop + +```bash +npx @open-mcp/config add _api_v3 \ + ~/Library/Application\ Support/Claude/claude_desktop_config.json \ + --OAUTH2_TOKEN=$OAUTH2_TOKEN \ + --API_KEY=$API_KEY +``` + +### Cursor + +Run this from the root of your project directory or, to add to all cursor projects, run it from your home directory `~`. + +```bash +npx @open-mcp/config add _api_v3 \ + .cursor/mcp.json \ + --OAUTH2_TOKEN=$OAUTH2_TOKEN \ + --API_KEY=$API_KEY +``` + +### Other + +```bash +npx @open-mcp/config add _api_v3 \ + /path/to/client/config.json \ + --OAUTH2_TOKEN=$OAUTH2_TOKEN \ + --API_KEY=$API_KEY +``` + +### Manually + +If you don't want to use the helper above, add the following to your MCP client config manually: + +```json +{ + "mcpServers": { + "_api_v3": { + "command": "npx", + "args": ["-y", "@open-mcp/_api_v3"], + "env": {"OAUTH2_TOKEN":"...","API_KEY":"..."} + } + } +} +``` + +## Environment variables + +- `OPEN_MCP_BASE_URL` - overwrites the base URL of every tool's underlying API request +- `OAUTH2_TOKEN` - gets sent to the API provider +- `API_KEY` - gets sent to the API provider + +## Tools + +### expandSchema + +Expand the input schema for a tool before calling the tool + +**Input schema** + +- `toolName` (string) +- `jsonPointers` (array) + +### updatepet + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `id` (integer) +- `name` (string) +- `category` (object) +- `photoUrls` (array) +- `tags` (array) +- `status` (string) + +### addpet + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `id` (integer) +- `name` (string) +- `category` (object) +- `photoUrls` (array) +- `tags` (array) +- `status` (string) + +### findpetsbystatus + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `status` (string) + +### findpetsbytags + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `tags` (array) + +### getpetbyid + +**Environment variables** + +- `API_KEY` +- `OAUTH2_TOKEN` + +**Input schema** + +- `petId` (integer) + +### updatepetwithform + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `petId` (integer) +- `name` (string) +- `status` (string) + +### deletepet + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `petId` (integer) +- `api_key` (string) + +### uploadfile + +**Environment variables** + +- `OAUTH2_TOKEN` + +**Input schema** + +- `petId` (integer) +- `additionalMetadata` (string) + +### getinventory + +**Environment variables** + +- `API_KEY` + +**Input schema** + +No input parameters + +### placeorder + +**Environment variables** + +No environment variables required + +**Input schema** + +- `id` (integer) +- `petId` (integer) +- `quantity` (integer) +- `shipDate` (string) +- `status` (string) +- `complete` (boolean) + +### getorderbyid + +**Environment variables** + +No environment variables required + +**Input schema** + +- `orderId` (integer) + +### deleteorder + +**Environment variables** + +No environment variables required + +**Input schema** + +- `orderId` (integer) + +### createuser + +**Environment variables** + +No environment variables required + +**Input schema** + +- `id` (integer) +- `username` (string) +- `firstName` (string) +- `lastName` (string) +- `email` (string) +- `password` (string) +- `phone` (string) +- `userStatus` (integer) + +### createuserswithlistinput + +**Environment variables** + +No environment variables required + +**Input schema** + +No input parameters + +### loginuser + +**Environment variables** + +No environment variables required + +**Input schema** + +- `username` (string) +- `password` (string) + +### logoutuser + +**Environment variables** + +No environment variables required + +**Input schema** + +No input parameters + +### getuserbyname + +**Environment variables** + +No environment variables required + +**Input schema** + +- `username` (string) + +### updateuser + +**Environment variables** + +No environment variables required + +**Input schema** + +- `username` (string) +- `id` (integer) +- `b_username` (string) +- `firstName` (string) +- `lastName` (string) +- `email` (string) +- `password` (string) +- `phone` (string) +- `userStatus` (integer) + +### deleteuser + +**Environment variables** + +No environment variables required + +**Input schema** + +- `username` (string) diff --git a/servers/_api_v3/package.json b/servers/_api_v3/package.json new file mode 100644 index 0000000000..dcc4eb8fe8 --- /dev/null +++ b/servers/_api_v3/package.json @@ -0,0 +1,36 @@ +{ + "name": "@open-mcp/_api_v3", + "version": "0.0.1", + "main": "dist/index.js", + "type": "module", + "bin": { + "_api_v3": "./dist/index.js" + }, + "files": [ + "dist" + ], + "scripts": { + "clean": "rm -rf dist", + "copy-json-schema": "mkdir -p dist/tools && find src/tools -type d -name 'schema-json' -exec sh -c 'mkdir -p dist/tools/$(dirname {} | sed \"s/src\\/tools\\///\") && cp -r {} dist/tools/$(dirname {} | sed \"s/src\\/tools\\///\")/' \\;", + "prebuild": "npm run clean && npm run copy-json-schema", + "build": "tsc && chmod 755 dist/index.js", + "test": "echo \"No test specified\"", + "prepublishOnly": "npm install && npm run build && npm run test" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.9.0", + "@open-mcp/core": "latest", + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^22.14.1", + "typescript": "^5.8.3" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/servers/_api_v3/src/constants.ts b/servers/_api_v3/src/constants.ts new file mode 100644 index 0000000000..4fea9f8d4f --- /dev/null +++ b/servers/_api_v3/src/constants.ts @@ -0,0 +1,24 @@ +export const OPENAPI_URL = "https://petstore3.swagger.io/api/v3/openapi.json" +export const SERVER_NAME = "_api_v3" +export const SERVER_VERSION = "0.0.1" +export const OPERATION_FILES_RELATIVE = [ + "./tools/updatepet/index.js", + "./tools/addpet/index.js", + "./tools/findpetsbystatus/index.js", + "./tools/findpetsbytags/index.js", + "./tools/getpetbyid/index.js", + "./tools/updatepetwithform/index.js", + "./tools/deletepet/index.js", + "./tools/uploadfile/index.js", + "./tools/getinventory/index.js", + "./tools/placeorder/index.js", + "./tools/getorderbyid/index.js", + "./tools/deleteorder/index.js", + "./tools/createuser/index.js", + "./tools/createuserswithlistinput/index.js", + "./tools/loginuser/index.js", + "./tools/logoutuser/index.js", + "./tools/getuserbyname/index.js", + "./tools/updateuser/index.js", + "./tools/deleteuser/index.js" +] \ No newline at end of file diff --git a/servers/_api_v3/src/index.ts b/servers/_api_v3/src/index.ts new file mode 100644 index 0000000000..8a9dfa1017 --- /dev/null +++ b/servers/_api_v3/src/index.ts @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +const TOOLS_ARG_NAME = "--tools" + +function parseCSV(csv: string | undefined) { + if (!csv) { + return undefined + } + const arr = csv + .trim() + .split(",") + .filter((x) => x !== "") + return arr.length > 0 ? arr : undefined +} + +import("./server.js").then((module) => { + const args = process.argv.slice(2) + const toolsCSV = args + .find((arg) => arg.startsWith(TOOLS_ARG_NAME)) + ?.replace(TOOLS_ARG_NAME, "") + + const toolNames = parseCSV(toolsCSV) + + module.runServer({ toolNames }).catch((error) => { + console.error("Fatal error running server:", error) + process.exit(1) + }) +}) diff --git a/servers/_api_v3/src/server.ts b/servers/_api_v3/src/server.ts new file mode 100644 index 0000000000..0279956852 --- /dev/null +++ b/servers/_api_v3/src/server.ts @@ -0,0 +1,33 @@ +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js" +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" +import { registerTools } from "@open-mcp/core" +import type { OpenMCPServerTool } from "@open-mcp/core" +import { + SERVER_NAME, + SERVER_VERSION, + OPERATION_FILES_RELATIVE, +} from "./constants.js" + +const server = new McpServer({ + name: SERVER_NAME, + version: SERVER_VERSION, +}) + +export async function runServer({ toolNames }: { toolNames?: string[] }) { + try { + const tools: OpenMCPServerTool[] = [] + for (const file of OPERATION_FILES_RELATIVE) { + const tool = (await import(file)).default as OpenMCPServerTool + if (!toolNames || toolNames.includes(tool.toolName)) { + tools.push(tool) + } + } + await registerTools(server, tools) + const transport = new StdioServerTransport() + await server.connect(transport) + console.error("MCP Server running on stdio") + } catch (error) { + console.error("Error during initialization:", error) + process.exit(1) + } +} diff --git a/servers/_api_v3/src/tools/addpet/index.ts b/servers/_api_v3/src/tools/addpet/index.ts new file mode 100644 index 0000000000..149d6c3543 --- /dev/null +++ b/servers/_api_v3/src/tools/addpet/index.ts @@ -0,0 +1,31 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "addpet", + "toolDescription": "Add a new pet to the store.", + "baseUrl": "/api/v3", + "path": "/pet", + "method": "post", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "body": { + "id": "id", + "name": "name", + "category": "category", + "photoUrls": "photoUrls", + "tags": "tags", + "status": "status" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/addpet/schema-json/properties/category.json b/servers/_api_v3/src/tools/addpet/schema-json/properties/category.json new file mode 100644 index 0000000000..1b6e008c48 --- /dev/null +++ b/servers/_api_v3/src/tools/addpet/schema-json/properties/category.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "name": { + "type": "string", + "example": "Dogs" + } + }, + "xml": { + "name": "category" + } +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/addpet/schema-json/root.json b/servers/_api_v3/src/tools/addpet/schema-json/root.json new file mode 100644 index 0000000000..1be380ec79 --- /dev/null +++ b/servers/_api_v3/src/tools/addpet/schema-json/root.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 10 + }, + "name": { + "type": "string", + "example": "doggie" + }, + "category": { + "type": "object", + "description": "This part of the input schema is truncated. If you want to pass the property `category` to the tool, first call the tool `expandSchema` with \"/properties/category\" in the list of pointers. This will return the expanded input schema which you can then use in the tool call. You may have to call `expandSchema` multiple times if the schema is nested.", + "additionalProperties": true + }, + "photoUrls": { + "type": "array", + "xml": { + "wrapped": true + }, + "items": { + "type": "string", + "xml": { + "name": "photoUrl" + } + } + }, + "tags": { + "type": "array", + "xml": { + "wrapped": true + }, + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "xml": { + "name": "tag" + } + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ] + } + }, + "required": [ + "name", + "photoUrls" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/addpet/schema/properties/category.ts b/servers/_api_v3/src/tools/addpet/schema/properties/category.ts new file mode 100644 index 0000000000..9a0792f110 --- /dev/null +++ b/servers/_api_v3/src/tools/addpet/schema/properties/category.ts @@ -0,0 +1,6 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "id": z.number().int().optional(), + "name": z.string().optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/addpet/schema/root.ts b/servers/_api_v3/src/tools/addpet/schema/root.ts new file mode 100644 index 0000000000..a9e57a39f4 --- /dev/null +++ b/servers/_api_v3/src/tools/addpet/schema/root.ts @@ -0,0 +1,10 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "id": z.number().int().optional(), + "name": z.string(), + "category": z.record(z.any()).describe("This part of the input schema is truncated. If you want to pass the property `category` to the tool, first call the tool `expandSchema` with \"/properties/category\" in the list of pointers. This will return the expanded input schema which you can then use in the tool call. You may have to call `expandSchema` multiple times if the schema is nested.").optional(), + "photoUrls": z.array(z.string()), + "tags": z.array(z.object({ "id": z.number().int().optional(), "name": z.string().optional() })).optional(), + "status": z.enum(["available","pending","sold"]).describe("pet status in the store").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/createuser/index.ts b/servers/_api_v3/src/tools/createuser/index.ts new file mode 100644 index 0000000000..93b2e32a29 --- /dev/null +++ b/servers/_api_v3/src/tools/createuser/index.ts @@ -0,0 +1,26 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "createuser", + "toolDescription": "Create user.", + "baseUrl": "/api/v3", + "path": "/user", + "method": "post", + "security": [], + "paramsMap": { + "body": { + "id": "id", + "username": "username", + "firstName": "firstName", + "lastName": "lastName", + "email": "email", + "password": "password", + "phone": "phone", + "userStatus": "userStatus" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/createuser/schema-json/root.json b/servers/_api_v3/src/tools/createuser/schema-json/root.json new file mode 100644 index 0000000000..b4942c6a78 --- /dev/null +++ b/servers/_api_v3/src/tools/createuser/schema-json/root.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 10 + }, + "username": { + "type": "string", + "example": "theUser" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "James" + }, + "email": { + "type": "string", + "example": "john@email.com" + }, + "password": { + "type": "string", + "example": "12345" + }, + "phone": { + "type": "string", + "example": "12345" + }, + "userStatus": { + "type": "integer", + "description": "User Status", + "format": "int32", + "example": 1 + } + }, + "required": [] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/createuser/schema/root.ts b/servers/_api_v3/src/tools/createuser/schema/root.ts new file mode 100644 index 0000000000..63c4ca6cca --- /dev/null +++ b/servers/_api_v3/src/tools/createuser/schema/root.ts @@ -0,0 +1,12 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "id": z.number().int().optional(), + "username": z.string().optional(), + "firstName": z.string().optional(), + "lastName": z.string().optional(), + "email": z.string().optional(), + "password": z.string().optional(), + "phone": z.string().optional(), + "userStatus": z.number().int().describe("User Status").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/createuserswithlistinput/index.ts b/servers/_api_v3/src/tools/createuserswithlistinput/index.ts new file mode 100644 index 0000000000..b743a12da7 --- /dev/null +++ b/servers/_api_v3/src/tools/createuserswithlistinput/index.ts @@ -0,0 +1,15 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "createuserswithlistinput", + "toolDescription": "Creates list of users with given input array.", + "baseUrl": "/api/v3", + "path": "/user/createWithList", + "method": "post", + "security": [], + "paramsMap": {}, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/createuserswithlistinput/schema-json/root.json b/servers/_api_v3/src/tools/createuserswithlistinput/schema-json/root.json new file mode 100644 index 0000000000..23dcd4be45 --- /dev/null +++ b/servers/_api_v3/src/tools/createuserswithlistinput/schema-json/root.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "required": [] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/createuserswithlistinput/schema/root.ts b/servers/_api_v3/src/tools/createuserswithlistinput/schema/root.ts new file mode 100644 index 0000000000..a3a8f97e4b --- /dev/null +++ b/servers/_api_v3/src/tools/createuserswithlistinput/schema/root.ts @@ -0,0 +1,3 @@ +import { z } from "zod" + +export const inputParamsSchema = {} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deleteorder/index.ts b/servers/_api_v3/src/tools/deleteorder/index.ts new file mode 100644 index 0000000000..e832625e36 --- /dev/null +++ b/servers/_api_v3/src/tools/deleteorder/index.ts @@ -0,0 +1,19 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "deleteorder", + "toolDescription": "Delete purchase order by identifier.", + "baseUrl": "/api/v3", + "path": "/store/order/{orderId}", + "method": "delete", + "security": [], + "paramsMap": { + "path": { + "orderId": "orderId" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deleteorder/schema-json/root.json b/servers/_api_v3/src/tools/deleteorder/schema-json/root.json new file mode 100644 index 0000000000..4bca830963 --- /dev/null +++ b/servers/_api_v3/src/tools/deleteorder/schema-json/root.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "orderId": { + "description": "ID of the order that needs to be deleted", + "type": "integer", + "format": "int64" + } + }, + "required": [ + "orderId" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deleteorder/schema/root.ts b/servers/_api_v3/src/tools/deleteorder/schema/root.ts new file mode 100644 index 0000000000..693ea0c3f9 --- /dev/null +++ b/servers/_api_v3/src/tools/deleteorder/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "orderId": z.number().int().describe("ID of the order that needs to be deleted") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deletepet/index.ts b/servers/_api_v3/src/tools/deletepet/index.ts new file mode 100644 index 0000000000..003c4b84e3 --- /dev/null +++ b/servers/_api_v3/src/tools/deletepet/index.ts @@ -0,0 +1,29 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "deletepet", + "toolDescription": "Deletes a pet.", + "baseUrl": "/api/v3", + "path": "/pet/{petId}", + "method": "delete", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "path": { + "petId": "petId" + }, + "header": { + "api_key": "api_key" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deletepet/schema-json/root.json b/servers/_api_v3/src/tools/deletepet/schema-json/root.json new file mode 100644 index 0000000000..0e1f8c7bf6 --- /dev/null +++ b/servers/_api_v3/src/tools/deletepet/schema-json/root.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "petId": { + "description": "Pet id to delete", + "type": "integer", + "format": "int64" + }, + "api_key": { + "description": "", + "type": "string" + } + }, + "required": [ + "petId" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deletepet/schema/root.ts b/servers/_api_v3/src/tools/deletepet/schema/root.ts new file mode 100644 index 0000000000..b16f65fd21 --- /dev/null +++ b/servers/_api_v3/src/tools/deletepet/schema/root.ts @@ -0,0 +1,6 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "petId": z.number().int().describe("Pet id to delete"), + "api_key": z.string().optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deleteuser/index.ts b/servers/_api_v3/src/tools/deleteuser/index.ts new file mode 100644 index 0000000000..62890fde79 --- /dev/null +++ b/servers/_api_v3/src/tools/deleteuser/index.ts @@ -0,0 +1,19 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "deleteuser", + "toolDescription": "Delete user resource.", + "baseUrl": "/api/v3", + "path": "/user/{username}", + "method": "delete", + "security": [], + "paramsMap": { + "path": { + "username": "username" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deleteuser/schema-json/root.json b/servers/_api_v3/src/tools/deleteuser/schema-json/root.json new file mode 100644 index 0000000000..7945c014ab --- /dev/null +++ b/servers/_api_v3/src/tools/deleteuser/schema-json/root.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "username": { + "description": "The name that needs to be deleted", + "type": "string" + } + }, + "required": [ + "username" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/deleteuser/schema/root.ts b/servers/_api_v3/src/tools/deleteuser/schema/root.ts new file mode 100644 index 0000000000..cb12fd5e2b --- /dev/null +++ b/servers/_api_v3/src/tools/deleteuser/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "username": z.string().describe("The name that needs to be deleted") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/findpetsbystatus/index.ts b/servers/_api_v3/src/tools/findpetsbystatus/index.ts new file mode 100644 index 0000000000..eb157fc614 --- /dev/null +++ b/servers/_api_v3/src/tools/findpetsbystatus/index.ts @@ -0,0 +1,26 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "findpetsbystatus", + "toolDescription": "Finds Pets by status.", + "baseUrl": "/api/v3", + "path": "/pet/findByStatus", + "method": "get", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "query": { + "status": "status" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/findpetsbystatus/schema-json/root.json b/servers/_api_v3/src/tools/findpetsbystatus/schema-json/root.json new file mode 100644 index 0000000000..ebe2f16190 --- /dev/null +++ b/servers/_api_v3/src/tools/findpetsbystatus/schema-json/root.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "status": { + "description": "Status values that need to be considered for filter", + "type": "string", + "default": "available", + "enum": [ + "available", + "pending", + "sold" + ] + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/findpetsbystatus/schema/root.ts b/servers/_api_v3/src/tools/findpetsbystatus/schema/root.ts new file mode 100644 index 0000000000..7e29148b01 --- /dev/null +++ b/servers/_api_v3/src/tools/findpetsbystatus/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "status": z.enum(["available","pending","sold"]).describe("Status values that need to be considered for filter") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/findpetsbytags/index.ts b/servers/_api_v3/src/tools/findpetsbytags/index.ts new file mode 100644 index 0000000000..e82af2a728 --- /dev/null +++ b/servers/_api_v3/src/tools/findpetsbytags/index.ts @@ -0,0 +1,26 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "findpetsbytags", + "toolDescription": "Finds Pets by tags.", + "baseUrl": "/api/v3", + "path": "/pet/findByTags", + "method": "get", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "query": { + "tags": "tags" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/findpetsbytags/schema-json/root.json b/servers/_api_v3/src/tools/findpetsbytags/schema-json/root.json new file mode 100644 index 0000000000..887fef843e --- /dev/null +++ b/servers/_api_v3/src/tools/findpetsbytags/schema-json/root.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "tags": { + "description": "Tags to filter by", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "tags" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/findpetsbytags/schema/root.ts b/servers/_api_v3/src/tools/findpetsbytags/schema/root.ts new file mode 100644 index 0000000000..d9c42cf0a2 --- /dev/null +++ b/servers/_api_v3/src/tools/findpetsbytags/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "tags": z.array(z.string()).describe("Tags to filter by") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getinventory/index.ts b/servers/_api_v3/src/tools/getinventory/index.ts new file mode 100644 index 0000000000..d767f5b0cc --- /dev/null +++ b/servers/_api_v3/src/tools/getinventory/index.ts @@ -0,0 +1,22 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "getinventory", + "toolDescription": "Returns pet inventories by status.", + "baseUrl": "/api/v3", + "path": "/store/inventory", + "method": "get", + "security": [ + { + "key": "api_key", + "value": "API_KEY", + "in": "header", + "envVarName": "API_KEY" + } + ], + "paramsMap": {}, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getinventory/schema-json/root.json b/servers/_api_v3/src/tools/getinventory/schema-json/root.json new file mode 100644 index 0000000000..23dcd4be45 --- /dev/null +++ b/servers/_api_v3/src/tools/getinventory/schema-json/root.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "required": [] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getinventory/schema/root.ts b/servers/_api_v3/src/tools/getinventory/schema/root.ts new file mode 100644 index 0000000000..a3a8f97e4b --- /dev/null +++ b/servers/_api_v3/src/tools/getinventory/schema/root.ts @@ -0,0 +1,3 @@ +import { z } from "zod" + +export const inputParamsSchema = {} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getorderbyid/index.ts b/servers/_api_v3/src/tools/getorderbyid/index.ts new file mode 100644 index 0000000000..ae825655e1 --- /dev/null +++ b/servers/_api_v3/src/tools/getorderbyid/index.ts @@ -0,0 +1,19 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "getorderbyid", + "toolDescription": "Find purchase order by ID.", + "baseUrl": "/api/v3", + "path": "/store/order/{orderId}", + "method": "get", + "security": [], + "paramsMap": { + "path": { + "orderId": "orderId" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getorderbyid/schema-json/root.json b/servers/_api_v3/src/tools/getorderbyid/schema-json/root.json new file mode 100644 index 0000000000..2cb339b7b2 --- /dev/null +++ b/servers/_api_v3/src/tools/getorderbyid/schema-json/root.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "orderId": { + "description": "ID of order that needs to be fetched", + "type": "integer", + "format": "int64" + } + }, + "required": [ + "orderId" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getorderbyid/schema/root.ts b/servers/_api_v3/src/tools/getorderbyid/schema/root.ts new file mode 100644 index 0000000000..a58525b41c --- /dev/null +++ b/servers/_api_v3/src/tools/getorderbyid/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "orderId": z.number().int().describe("ID of order that needs to be fetched") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getpetbyid/index.ts b/servers/_api_v3/src/tools/getpetbyid/index.ts new file mode 100644 index 0000000000..9f679f9c75 --- /dev/null +++ b/servers/_api_v3/src/tools/getpetbyid/index.ts @@ -0,0 +1,32 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "getpetbyid", + "toolDescription": "Find pet by ID.", + "baseUrl": "/api/v3", + "path": "/pet/{petId}", + "method": "get", + "security": [ + { + "key": "api_key", + "value": "API_KEY", + "in": "header", + "envVarName": "API_KEY" + }, + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "path": { + "petId": "petId" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getpetbyid/schema-json/root.json b/servers/_api_v3/src/tools/getpetbyid/schema-json/root.json new file mode 100644 index 0000000000..8b206ab81f --- /dev/null +++ b/servers/_api_v3/src/tools/getpetbyid/schema-json/root.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "petId": { + "description": "ID of pet to return", + "type": "integer", + "format": "int64" + } + }, + "required": [ + "petId" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getpetbyid/schema/root.ts b/servers/_api_v3/src/tools/getpetbyid/schema/root.ts new file mode 100644 index 0000000000..5f60dbddd7 --- /dev/null +++ b/servers/_api_v3/src/tools/getpetbyid/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "petId": z.number().int().describe("ID of pet to return") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getuserbyname/index.ts b/servers/_api_v3/src/tools/getuserbyname/index.ts new file mode 100644 index 0000000000..7fab73ac87 --- /dev/null +++ b/servers/_api_v3/src/tools/getuserbyname/index.ts @@ -0,0 +1,19 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "getuserbyname", + "toolDescription": "Get user by user name.", + "baseUrl": "/api/v3", + "path": "/user/{username}", + "method": "get", + "security": [], + "paramsMap": { + "path": { + "username": "username" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getuserbyname/schema-json/root.json b/servers/_api_v3/src/tools/getuserbyname/schema-json/root.json new file mode 100644 index 0000000000..a7a8a0bb7f --- /dev/null +++ b/servers/_api_v3/src/tools/getuserbyname/schema-json/root.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "username": { + "description": "The name that needs to be fetched. Use user1 for testing", + "type": "string" + } + }, + "required": [ + "username" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/getuserbyname/schema/root.ts b/servers/_api_v3/src/tools/getuserbyname/schema/root.ts new file mode 100644 index 0000000000..730deab936 --- /dev/null +++ b/servers/_api_v3/src/tools/getuserbyname/schema/root.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "username": z.string().describe("The name that needs to be fetched. Use user1 for testing") +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/loginuser/index.ts b/servers/_api_v3/src/tools/loginuser/index.ts new file mode 100644 index 0000000000..c696983086 --- /dev/null +++ b/servers/_api_v3/src/tools/loginuser/index.ts @@ -0,0 +1,20 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "loginuser", + "toolDescription": "Logs user into the system.", + "baseUrl": "/api/v3", + "path": "/user/login", + "method": "get", + "security": [], + "paramsMap": { + "query": { + "username": "username", + "password": "password" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/loginuser/schema-json/root.json b/servers/_api_v3/src/tools/loginuser/schema-json/root.json new file mode 100644 index 0000000000..364dc61703 --- /dev/null +++ b/servers/_api_v3/src/tools/loginuser/schema-json/root.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "username": { + "description": "The user name for login", + "type": "string" + }, + "password": { + "description": "The password for login in clear text", + "type": "string" + } + }, + "required": [] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/loginuser/schema/root.ts b/servers/_api_v3/src/tools/loginuser/schema/root.ts new file mode 100644 index 0000000000..1336b57b2c --- /dev/null +++ b/servers/_api_v3/src/tools/loginuser/schema/root.ts @@ -0,0 +1,6 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "username": z.string().describe("The user name for login").optional(), + "password": z.string().describe("The password for login in clear text").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/logoutuser/index.ts b/servers/_api_v3/src/tools/logoutuser/index.ts new file mode 100644 index 0000000000..8d63754cd1 --- /dev/null +++ b/servers/_api_v3/src/tools/logoutuser/index.ts @@ -0,0 +1,15 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "logoutuser", + "toolDescription": "Logs out current logged in user session.", + "baseUrl": "/api/v3", + "path": "/user/logout", + "method": "get", + "security": [], + "paramsMap": {}, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/logoutuser/schema-json/root.json b/servers/_api_v3/src/tools/logoutuser/schema-json/root.json new file mode 100644 index 0000000000..23dcd4be45 --- /dev/null +++ b/servers/_api_v3/src/tools/logoutuser/schema-json/root.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "required": [] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/logoutuser/schema/root.ts b/servers/_api_v3/src/tools/logoutuser/schema/root.ts new file mode 100644 index 0000000000..a3a8f97e4b --- /dev/null +++ b/servers/_api_v3/src/tools/logoutuser/schema/root.ts @@ -0,0 +1,3 @@ +import { z } from "zod" + +export const inputParamsSchema = {} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/placeorder/index.ts b/servers/_api_v3/src/tools/placeorder/index.ts new file mode 100644 index 0000000000..6365037002 --- /dev/null +++ b/servers/_api_v3/src/tools/placeorder/index.ts @@ -0,0 +1,24 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "placeorder", + "toolDescription": "Place an order for a pet.", + "baseUrl": "/api/v3", + "path": "/store/order", + "method": "post", + "security": [], + "paramsMap": { + "body": { + "id": "id", + "petId": "petId", + "quantity": "quantity", + "shipDate": "shipDate", + "status": "status", + "complete": "complete" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/placeorder/schema-json/root.json b/servers/_api_v3/src/tools/placeorder/schema-json/root.json new file mode 100644 index 0000000000..db9fd8d07d --- /dev/null +++ b/servers/_api_v3/src/tools/placeorder/schema-json/root.json @@ -0,0 +1,38 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 10 + }, + "petId": { + "type": "integer", + "format": "int64", + "example": 198772 + }, + "quantity": { + "type": "integer", + "format": "int32", + "example": 7 + }, + "shipDate": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order Status", + "example": "approved", + "enum": [ + "placed", + "approved", + "delivered" + ] + }, + "complete": { + "type": "boolean" + } + }, + "required": [] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/placeorder/schema/root.ts b/servers/_api_v3/src/tools/placeorder/schema/root.ts new file mode 100644 index 0000000000..1f388e4bc7 --- /dev/null +++ b/servers/_api_v3/src/tools/placeorder/schema/root.ts @@ -0,0 +1,10 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "id": z.number().int().optional(), + "petId": z.number().int().optional(), + "quantity": z.number().int().optional(), + "shipDate": z.string().datetime({ offset: true }).optional(), + "status": z.enum(["placed","approved","delivered"]).describe("Order Status").optional(), + "complete": z.boolean().optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepet/index.ts b/servers/_api_v3/src/tools/updatepet/index.ts new file mode 100644 index 0000000000..916788fb8b --- /dev/null +++ b/servers/_api_v3/src/tools/updatepet/index.ts @@ -0,0 +1,31 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "updatepet", + "toolDescription": "Update an existing pet.", + "baseUrl": "/api/v3", + "path": "/pet", + "method": "put", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "body": { + "id": "id", + "name": "name", + "category": "category", + "photoUrls": "photoUrls", + "tags": "tags", + "status": "status" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepet/schema-json/properties/category.json b/servers/_api_v3/src/tools/updatepet/schema-json/properties/category.json new file mode 100644 index 0000000000..1b6e008c48 --- /dev/null +++ b/servers/_api_v3/src/tools/updatepet/schema-json/properties/category.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "name": { + "type": "string", + "example": "Dogs" + } + }, + "xml": { + "name": "category" + } +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepet/schema-json/root.json b/servers/_api_v3/src/tools/updatepet/schema-json/root.json new file mode 100644 index 0000000000..1be380ec79 --- /dev/null +++ b/servers/_api_v3/src/tools/updatepet/schema-json/root.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 10 + }, + "name": { + "type": "string", + "example": "doggie" + }, + "category": { + "type": "object", + "description": "This part of the input schema is truncated. If you want to pass the property `category` to the tool, first call the tool `expandSchema` with \"/properties/category\" in the list of pointers. This will return the expanded input schema which you can then use in the tool call. You may have to call `expandSchema` multiple times if the schema is nested.", + "additionalProperties": true + }, + "photoUrls": { + "type": "array", + "xml": { + "wrapped": true + }, + "items": { + "type": "string", + "xml": { + "name": "photoUrl" + } + } + }, + "tags": { + "type": "array", + "xml": { + "wrapped": true + }, + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "xml": { + "name": "tag" + } + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ] + } + }, + "required": [ + "name", + "photoUrls" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepet/schema/properties/category.ts b/servers/_api_v3/src/tools/updatepet/schema/properties/category.ts new file mode 100644 index 0000000000..9a0792f110 --- /dev/null +++ b/servers/_api_v3/src/tools/updatepet/schema/properties/category.ts @@ -0,0 +1,6 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "id": z.number().int().optional(), + "name": z.string().optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepet/schema/root.ts b/servers/_api_v3/src/tools/updatepet/schema/root.ts new file mode 100644 index 0000000000..a9e57a39f4 --- /dev/null +++ b/servers/_api_v3/src/tools/updatepet/schema/root.ts @@ -0,0 +1,10 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "id": z.number().int().optional(), + "name": z.string(), + "category": z.record(z.any()).describe("This part of the input schema is truncated. If you want to pass the property `category` to the tool, first call the tool `expandSchema` with \"/properties/category\" in the list of pointers. This will return the expanded input schema which you can then use in the tool call. You may have to call `expandSchema` multiple times if the schema is nested.").optional(), + "photoUrls": z.array(z.string()), + "tags": z.array(z.object({ "id": z.number().int().optional(), "name": z.string().optional() })).optional(), + "status": z.enum(["available","pending","sold"]).describe("pet status in the store").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepetwithform/index.ts b/servers/_api_v3/src/tools/updatepetwithform/index.ts new file mode 100644 index 0000000000..8b0dfff4d5 --- /dev/null +++ b/servers/_api_v3/src/tools/updatepetwithform/index.ts @@ -0,0 +1,30 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "updatepetwithform", + "toolDescription": "Updates a pet in the store with form data.", + "baseUrl": "/api/v3", + "path": "/pet/{petId}", + "method": "post", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "path": { + "petId": "petId" + }, + "query": { + "name": "name", + "status": "status" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepetwithform/schema-json/root.json b/servers/_api_v3/src/tools/updatepetwithform/schema-json/root.json new file mode 100644 index 0000000000..7916521917 --- /dev/null +++ b/servers/_api_v3/src/tools/updatepetwithform/schema-json/root.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "petId": { + "description": "ID of pet that needs to be updated", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Name of pet that needs to be updated", + "type": "string" + }, + "status": { + "description": "Status of pet that needs to be updated", + "type": "string" + } + }, + "required": [ + "petId" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updatepetwithform/schema/root.ts b/servers/_api_v3/src/tools/updatepetwithform/schema/root.ts new file mode 100644 index 0000000000..d90051ab8b --- /dev/null +++ b/servers/_api_v3/src/tools/updatepetwithform/schema/root.ts @@ -0,0 +1,7 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "petId": z.number().int().describe("ID of pet that needs to be updated"), + "name": z.string().describe("Name of pet that needs to be updated").optional(), + "status": z.string().describe("Status of pet that needs to be updated").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updateuser/index.ts b/servers/_api_v3/src/tools/updateuser/index.ts new file mode 100644 index 0000000000..772297863a --- /dev/null +++ b/servers/_api_v3/src/tools/updateuser/index.ts @@ -0,0 +1,29 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "updateuser", + "toolDescription": "Update user resource.", + "baseUrl": "/api/v3", + "path": "/user/{username}", + "method": "put", + "security": [], + "paramsMap": { + "path": { + "username": "username" + }, + "body": { + "id": "id", + "username": "b_username", + "firstName": "firstName", + "lastName": "lastName", + "email": "email", + "password": "password", + "phone": "phone", + "userStatus": "userStatus" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updateuser/schema-json/root.json b/servers/_api_v3/src/tools/updateuser/schema-json/root.json new file mode 100644 index 0000000000..20c7f6216d --- /dev/null +++ b/servers/_api_v3/src/tools/updateuser/schema-json/root.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "username": { + "description": "name that need to be deleted", + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64", + "example": 10 + }, + "b_username": { + "type": "string", + "example": "theUser" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "James" + }, + "email": { + "type": "string", + "example": "john@email.com" + }, + "password": { + "type": "string", + "example": "12345" + }, + "phone": { + "type": "string", + "example": "12345" + }, + "userStatus": { + "type": "integer", + "description": "User Status", + "format": "int32", + "example": 1 + } + }, + "required": [ + "username" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/updateuser/schema/root.ts b/servers/_api_v3/src/tools/updateuser/schema/root.ts new file mode 100644 index 0000000000..a9a5992f6d --- /dev/null +++ b/servers/_api_v3/src/tools/updateuser/schema/root.ts @@ -0,0 +1,13 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "username": z.string().describe("name that need to be deleted"), + "id": z.number().int().optional(), + "b_username": z.string().optional(), + "firstName": z.string().optional(), + "lastName": z.string().optional(), + "email": z.string().optional(), + "password": z.string().optional(), + "phone": z.string().optional(), + "userStatus": z.number().int().describe("User Status").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/uploadfile/index.ts b/servers/_api_v3/src/tools/uploadfile/index.ts new file mode 100644 index 0000000000..e9e7440365 --- /dev/null +++ b/servers/_api_v3/src/tools/uploadfile/index.ts @@ -0,0 +1,29 @@ +import { inputParamsSchema } from "./schema/root.js" +import type { OpenMCPServerTool } from "@open-mcp/core" + +const tool: OpenMCPServerTool = { + "toolName": "uploadfile", + "toolDescription": "Uploads an image.", + "baseUrl": "/api/v3", + "path": "/pet/{petId}/uploadImage", + "method": "post", + "security": [ + { + "key": "Authorization", + "value": "Bearer OAUTH2_TOKEN", + "in": "header", + "envVarName": "OAUTH2_TOKEN" + } + ], + "paramsMap": { + "path": { + "petId": "petId" + }, + "query": { + "additionalMetadata": "additionalMetadata" + } + }, + inputParamsSchema +} + +export default tool \ No newline at end of file diff --git a/servers/_api_v3/src/tools/uploadfile/schema-json/root.json b/servers/_api_v3/src/tools/uploadfile/schema-json/root.json new file mode 100644 index 0000000000..d64b7d5013 --- /dev/null +++ b/servers/_api_v3/src/tools/uploadfile/schema-json/root.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "petId": { + "description": "ID of pet to update", + "type": "integer", + "format": "int64" + }, + "additionalMetadata": { + "description": "Additional Metadata", + "type": "string" + } + }, + "required": [ + "petId" + ] +} \ No newline at end of file diff --git a/servers/_api_v3/src/tools/uploadfile/schema/root.ts b/servers/_api_v3/src/tools/uploadfile/schema/root.ts new file mode 100644 index 0000000000..5cedd4e308 --- /dev/null +++ b/servers/_api_v3/src/tools/uploadfile/schema/root.ts @@ -0,0 +1,6 @@ +import { z } from "zod" + +export const inputParamsSchema = { + "petId": z.number().int().describe("ID of pet to update"), + "additionalMetadata": z.string().describe("Additional Metadata").optional() +} \ No newline at end of file diff --git a/servers/_api_v3/tsconfig.json b/servers/_api_v3/tsconfig.json new file mode 100644 index 0000000000..9d4d978a49 --- /dev/null +++ b/servers/_api_v3/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules"] +}