diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml index 325f2ee7..7d55e744 100644 --- a/.github/workflows/typescript.yml +++ b/.github/workflows/typescript.yml @@ -74,6 +74,6 @@ jobs: - name: Publish package working-directory: src/${{ matrix.package }} - run: npm publish # --provenance + run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index ea3d3dfc..e5f41461 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,21 @@ Each MCP server is implemented with either the [Typescript MCP SDK](https://gith These servers aim to demonstrate MCP features and the Typescript and Python SDK. +- **[AWS KB Retrieval](src/aws-kb-retrieval)** - Retrieval from AWS Knowledge Base using Bedrock Agent Runtime - **[Brave Search](src/brave-search)** - Web and local search using Brave's Search API +- **[EverArt](src/everart)** - AI image generation using various models - **[Fetch](src/fetch)** - Web content fetching and conversion for efficient LLM usage - **[Filesystem](src/filesystem)** - Secure file operations with configurable access controls +- **[Git](src/git)** - Tools to read, search, and manipulate Git repositories - **[GitHub](src/github)** - Repository management, file operations, and GitHub API integration - **[GitLab](src/gitlab)** - GitLab API, enabling project management -- **[Git](src/git)** - Tools to read, search, and manipulate Git repositories - **[Google Drive](src/gdrive)** - File access and search capabilities for Google Drive - **[Google Maps](src/google-maps)** - Location services, directions, and place details - **[Memory](src/memory)** - Knowledge graph-based persistent memory system - **[PostgreSQL](src/postgres)** - Read-only database access with schema inspection - **[Puppeteer](src/puppeteer)** - Browser automation and web scraping - **[Sentry](src/sentry)** - Retrieving and analyzing issues from Sentry.io +- **[Sequential Thinking](src/sequentialthinking)** - Dynamic and reflective problem-solving through thought sequences - **[Slack](src/slack)** - Channel management and messaging capabilities - **[Sqlite](src/sqlite)** - Database interaction and business intelligence capabilities @@ -31,6 +34,7 @@ These servers aim to demonstrate MCP features and the Typescript and Python SDK. Official integrations are maintained by companies building production ready MCP servers for their platforms. +- Browserbase Logo **[Browserbase](https://github.com/browserbase/mcp-server-browserbase)** - Automate browser interactions in the cloud (e.g. web navigation, data extraction, form filling, and more) - **[Cloudflare](https://github.com/cloudflare/mcp-server-cloudflare)** - Deploy, configure & interrogate your resources on the Cloudflare developer platform (e.g. Workers/KV/R2/D1) - **[Raygun](https://github.com/MindscapeHQ/mcp-server-raygun)** - Interact with your crash reporting and real using monitoring data on your Raygun account - E2B Logo **[E2B](https://github.com/e2b-dev/mcp-server)** - Run code in secure sandboxes hosted by [E2B](https://e2b.dev) @@ -48,8 +52,18 @@ A growing set of community-developed and maintained servers demonstrates various - **[MCP Installer](https://github.com/anaisbetts/mcp-installer)** - This server is a server that installs other MCP servers for you. - **[Spotify MCP](https://github.com/varunneal/spotify-mcp)** - This MCP allows an LLM to play and use Spotify. - **[Inoyu](https://github.com/sergehuber/inoyu-mcp-unomi-server)** - Interact with an Apache Unomi CDP customer data platform to retrieve and update customer profiles +- **[MySQL](https://github.com/designcomputer/mysql_mcp_server)** - MySQL database integration with configurable access controls and schema inspection - **[BigQuery](https://github.com/LucasHild/mcp-server-bigquery)** (by LucasHild) - This server enables LLMs to inspect database schemas and execute queries on BigQuery. - **[BigQuery](https://github.com/ergut/mcp-bigquery-server)** (by ergut) - Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities +- **[Todoist](https://github.com/abhiz123/todoist-mcp-server)** - Interact with Todoist to manage your tasks. +- **[Tavily search](https://github.com/RamXX/mcp-tavily")** - An MCP server for Tavily's search & news API, with explicit site inclusions/exclusions +- **[Linear](https://github.com/jerhadf/linear-mcp-server)** - Allows LLM to interact with Linear's API for project management, including searching, creating, and updating issues. +- **[Playwright MCP](https://github.com/executeautomation/mcp-playwright)** - This MCP Server will help you run browser automation and webscraping using Playwright +- **[AWS](https://github.com/rishikavikondala/mcp-server-aws)** - Perform operations on your AWS resources using an LLM +- **[LlamaCloud](https://github.com/run-llama/mcp-server-llamacloud)** (by marcusschiesser) - Integrate the data stored in a managed index on [LlamaCloud](https://cloud.llamaindex.ai/) +- **[Any Chat Completions](https://github.com/pyroprompts/any-chat-completions-mcp)** - Interact with any OpenAI SDK Compatible Chat Completions API like OpenAI, Perplexity, Groq, xAI and many more. +- **[Windows CLI](https://github.com/SimonB97/win-cli-mcp-server)** - MCP server for secure command-line interactions on Windows systems, enabling controlled access to PowerShell, CMD, and Git Bash shells. +- **[OpenRPC](https://github.com/shanejonas/openrpc-mpc-server)** - Interact with and discover JSON-RPC APIs via [OpenRPC](https://open-rpc.org). ## 📚 Resources @@ -59,6 +73,7 @@ Additional resources on MCP. - **[Awesome MCP Servers by wong2](https://github.com/wong2/awesome-mcp-servers)** - A curated list of MCP servers by **[wong2](https://github.com/wong2)** - **[Awesome MCP Servers by appcypher](https://github.com/appcypher/awesome-mcp-servers)** - A curated list of MCP servers by **[Stephen Akinyemi](https://github.com/appcypher)** - **[mcp-get](https://mcp-get.com)** - Command line tool for installing and managing MCP servers by **[Michael Latman](https://github.com/michaellatman)** +- **[mcp-cli](https://github.com/wong2/mcp-cli)** - A CLI inspector for the Model Context Protocol by **[wong2](https://github.com/wong2)** ## 🚀 Getting Started diff --git a/package-lock.json b/package-lock.json index fe9cfd6e..fa9ec691 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@modelcontextprotocol/servers", - "version": "0.5.1", + "version": "0.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@modelcontextprotocol/servers", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "workspaces": [ "src/*" @@ -24,6 +24,656 @@ "@modelcontextprotocol/server-slack": "*" } }, + "node_modules/@aws-crypto/crc32": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz", + "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", + "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", + "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", + "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-agent-runtime": { + "version": "3.706.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-agent-runtime/-/client-bedrock-agent-runtime-3.706.0.tgz", + "integrity": "sha512-XX9Nm88Pz8GdHQJ29h6xQlH21qRnaovtF2BeLdKJRKcS/ViZjqfSFt3B5p6BXf+wKW9YFciGwjuo0OOrDx1Oyw==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.699.0", + "@aws-sdk/client-sts": "3.699.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.699.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/eventstream-serde-browser": "^3.0.13", + "@smithy/eventstream-serde-config-resolver": "^3.0.10", + "@smithy/eventstream-serde-node": "^3.0.12", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.696.0.tgz", + "integrity": "sha512-q5TTkd08JS0DOkHfUL853tuArf7NrPeqoS5UOvqJho8ibV9Ak/a/HO4kNvy9Nj3cib/toHYHsQIEtecUPSUUrQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.699.0.tgz", + "integrity": "sha512-u8a1GorY5D1l+4FQAf4XBUC1T10/t7neuwT21r0ymrtMFSK2a9QqVHKMoLkvavAwyhJnARSBM9/UQC797PFOFw==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.699.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.699.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.699.0.tgz", + "integrity": "sha512-++lsn4x2YXsZPIzFVwv3fSUVM55ZT0WRFmPeNilYIhZClxHLmVAWKH4I55cY9ry60/aTKYjzOXkWwyBKGsGvQg==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.699.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.699.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.696.0.tgz", + "integrity": "sha512-3c9III1k03DgvRZWg8vhVmfIXPG6hAciN9MzQTzqGngzWAELZF/WONRTRQuDFixVtarQatmLHYVw/atGeA2Byw==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/core": "^2.5.3", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.7", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/util-middleware": "^3.0.10", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.696.0.tgz", + "integrity": "sha512-T9iMFnJL7YTlESLpVFT3fg1Lkb1lD+oiaIC8KMpepb01gDUBIpj9+Y+pA/cgRWW0yRxmkDXNazAE2qQTVFGJzA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.696.0.tgz", + "integrity": "sha512-GV6EbvPi2eq1+WgY/o2RFA3P7HGmnkIzCNmhwtALFlqMroLYWKE7PSeHw66Uh1dFQeVESn0/+hiUNhu1mB0emA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/util-stream": "^3.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.699.0.tgz", + "integrity": "sha512-dXmCqjJnKmG37Q+nLjPVu22mNkrGHY8hYoOt3Jo9R2zr5MYV7s/NHsCHr+7E+BZ+tfZYLRPeB1wkpTeHiEcdRw==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-env": "3.696.0", + "@aws-sdk/credential-provider-http": "3.696.0", + "@aws-sdk/credential-provider-process": "3.696.0", + "@aws-sdk/credential-provider-sso": "3.699.0", + "@aws-sdk/credential-provider-web-identity": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.699.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.699.0.tgz", + "integrity": "sha512-MmEmNDo1bBtTgRmdNfdQksXu4uXe66s0p1hi1YPrn1h59Q605eq/xiWbGL6/3KdkViH6eGUuABeV2ODld86ylg==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.696.0", + "@aws-sdk/credential-provider-http": "3.696.0", + "@aws-sdk/credential-provider-ini": "3.699.0", + "@aws-sdk/credential-provider-process": "3.696.0", + "@aws-sdk/credential-provider-sso": "3.699.0", + "@aws-sdk/credential-provider-web-identity": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.696.0.tgz", + "integrity": "sha512-mL1RcFDe9sfmyU5K1nuFkO8UiJXXxLX4JO1gVaDIOvPqwStpUAwi3A1BoeZhWZZNQsiKI810RnYGo0E0WB/hUA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.699.0.tgz", + "integrity": "sha512-Ekp2cZG4pl9D8+uKWm4qO1xcm8/MeiI8f+dnlZm8aQzizeC+aXYy9GyoclSf6daK8KfRPiRfM7ZHBBL5dAfdMA==", + "dependencies": { + "@aws-sdk/client-sso": "3.696.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/token-providers": "3.699.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.696.0.tgz", + "integrity": "sha512-XJ/CVlWChM0VCoc259vWguFUjJDn/QwDqHwbx+K9cg3v6yrqXfK5ai+p/6lx0nQpnk4JzPVeYYxWRpaTsGC9rg==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.696.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.696.0.tgz", + "integrity": "sha512-zELJp9Ta2zkX7ELggMN9qMCgekqZhFC5V2rOr4hJDEb/Tte7gpfKSObAnw/3AYiVqt36sjHKfdkoTsuwGdEoDg==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.696.0.tgz", + "integrity": "sha512-KhkHt+8AjCxcR/5Zp3++YPJPpFQzxpr+jmONiT/Jw2yqnSngZ0Yspm5wGoRx2hS1HJbyZNuaOWEGuJoxLeBKfA==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.696.0.tgz", + "integrity": "sha512-si/maV3Z0hH7qa99f9ru2xpS5HlfSVcasRlNUXKSDm611i7jFMWwGNLUOXFAOLhXotPX5G3Z6BLwL34oDeBMug==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.696.0.tgz", + "integrity": "sha512-Lvyj8CTyxrHI6GHd2YVZKIRI5Fmnugt3cpJo0VrKKEgK5zMySwEZ1n4dqPK6czYRWKd5+WnYHYAuU+Wdk6Jsjw==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@smithy/core": "^2.5.3", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.696.0.tgz", + "integrity": "sha512-7EuH142lBXjI8yH6dVS/CZeiK/WZsmb/8zP6bQbVYpMrppSTgB3MzZZdxVZGzL5r8zPQOU10wLC4kIMy0qdBVQ==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.699.0.tgz", + "integrity": "sha512-kuiEW9DWs7fNos/SM+y58HCPhcIzm1nEZLhe2/7/6+TvAYLuEWURYsbK48gzsxXlaJ2k/jGY3nIsA7RptbMOwA==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.699.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.696.0.tgz", + "integrity": "sha512-9rTvUJIAj5d3//U5FDPWGJ1nFJLuWb30vugGOrWk7aNZ6y9tuA3PI7Cc9dP8WEXKVyK1vuuk8rSFP2iqXnlgrw==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.696.0.tgz", + "integrity": "sha512-T5s0IlBVX+gkb9g/I6CLt4yAZVzMSiGnbUqWihWsHvQR1WOoIcndQy/Oz/IJXT9T2ipoy7a80gzV6a5mglrioA==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/types": "^3.7.1", + "@smithy/util-endpoints": "^2.1.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.693.0.tgz", + "integrity": "sha512-ttrag6haJLWABhLqtg1Uf+4LgHWIMOVSYL+VYZmAp2v4PUGOwWmWQH0Zk8RM7YuQcLfH/EoR72/Yxz6A4FKcuw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.696.0.tgz", + "integrity": "sha512-Z5rVNDdmPOe6ELoM5AhF/ja5tSjbe6ctSctDPb0JdDf4dT0v2MfwhJKzXju2RzX8Es/77Glh7MlaXLE0kCB9+Q==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/types": "^3.7.1", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.696.0.tgz", + "integrity": "sha512-KhKqcfyXIB0SCCt+qsu4eJjsfiOrNzK5dCV7RAW2YIpp+msxGUUX0NdRE9rkzjiv+3EMktgJm3eEIS+yxtlVdQ==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -165,6 +815,10 @@ "zod": "^3.23.8" } }, + "node_modules/@modelcontextprotocol/server-aws-kb-retrieval": { + "resolved": "src/aws-kb-retrieval-server", + "link": true + }, "node_modules/@modelcontextprotocol/server-brave-search": { "resolved": "src/brave-search", "link": true @@ -269,6 +923,582 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/@smithy/abort-controller": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.8.tgz", + "integrity": "sha512-+3DOBcUn5/rVjlxGvUPKc416SExarAQ+Qe0bqk30YSUjbepwpS7QN0cyKUSifvLJhdMZ0WPzPP5ymut0oonrpQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.12.tgz", + "integrity": "sha512-YAJP9UJFZRZ8N+UruTeq78zkdjUHmzsY62J4qKWZ4SXB4QXJ/+680EfXXgkYA2xj77ooMqtUY9m406zGNqwivQ==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.5.4.tgz", + "integrity": "sha512-iFh2Ymn2sCziBRLPuOOxRPkuCx/2gBdXtBGuCUFLUe6bWYjKnhHyIPqGeNkLZ5Aco/5GjebRTBFiWID3sDbrKw==", + "dependencies": { + "@smithy/middleware-serde": "^3.0.10", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-stream": "^3.3.1", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.7.tgz", + "integrity": "sha512-cEfbau+rrWF8ylkmmVAObOmjbTIzKyUC5TkBL58SbLywD0RCBC4JAUKbmtSm2w5KUJNRPGgpGFMvE2FKnuNlWQ==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/property-provider": "^3.1.10", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-3.1.9.tgz", + "integrity": "sha512-F574nX0hhlNOjBnP+noLtsPFqXnWh2L0+nZKCwcu7P7J8k+k+rdIDs+RMnrMwrzhUE4mwMgyN0cYnEn0G8yrnQ==", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^3.7.1", + "@smithy/util-hex-encoding": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-3.0.13.tgz", + "integrity": "sha512-Nee9m+97o9Qj6/XeLz2g2vANS2SZgAxV4rDBMKGHvFJHU/xz88x2RwCkwsvEwYjSX4BV1NG1JXmxEaDUzZTAtw==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.12", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.0.10.tgz", + "integrity": "sha512-K1M0x7P7qbBUKB0UWIL5KOcyi6zqV5mPJoL0/o01HPJr0CSq3A9FYuJC6e11EX6hR8QTIR++DBiGrYveOu6trw==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-3.0.12.tgz", + "integrity": "sha512-kiZymxXvZ4tnuYsPSMUHe+MMfc4FTeFWJIc0Q5wygJoUQM4rVHNghvd48y7ppuulNMbuYt95ah71pYc2+o4JOA==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.12", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-3.0.12.tgz", + "integrity": "sha512-1i8ifhLJrOZ+pEifTlF0EfZzMLUGQggYQ6WmZ4d5g77zEKf7oZ0kvh1yKWHPjofvOwqrkwRDVuxuYC8wVd662A==", + "dependencies": { + "@smithy/eventstream-codec": "^3.1.9", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-4.1.1.tgz", + "integrity": "sha512-bH7QW0+JdX0bPBadXt8GwMof/jz0H28I84hU1Uet9ISpzUqXqRQ3fEZJ+ANPOhzSEczYvANNl3uDQDYArSFDtA==", + "dependencies": { + "@smithy/protocol-http": "^4.1.7", + "@smithy/querystring-builder": "^3.0.10", + "@smithy/types": "^3.7.1", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/hash-node": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.10.tgz", + "integrity": "sha512-3zWGWCHI+FlJ5WJwx73Mw2llYR8aflVyZN5JhoqLxbdPZi6UyKSdCeXAWJw9ja22m6S6Tzz1KZ+kAaSwvydi0g==", + "dependencies": { + "@smithy/types": "^3.7.1", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.10.tgz", + "integrity": "sha512-Lp2L65vFi+cj0vFMu2obpPW69DU+6O5g3086lmI4XcnRCG8PxvpWC7XyaVwJCxsZFzueHjXnrOH/E0pl0zikfA==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", + "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.12.tgz", + "integrity": "sha512-1mDEXqzM20yywaMDuf5o9ue8OkJ373lSPbaSjyEvkWdqELhFMyNNgKGWL/rCSf4KME8B+HlHKuR8u9kRj8HzEQ==", + "dependencies": { + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.2.4.tgz", + "integrity": "sha512-TybiW2LA3kYVd3e+lWhINVu1o26KJbBwOpADnf0L4x/35vLVica77XVR5hvV9+kWeTGeSJ3IHTcYxbRxlbwhsg==", + "dependencies": { + "@smithy/core": "^2.5.4", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/shared-ini-file-loader": "^3.1.11", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-middleware": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.28.tgz", + "integrity": "sha512-vK2eDfvIXG1U64FEUhYxoZ1JSj4XFbYWkK36iz02i3pFwWiDz1Q7jKhGTBCwx/7KqJNk4VS7d7cDLXFOvP7M+g==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/protocol-http": "^4.1.7", + "@smithy/service-error-classification": "^3.0.10", + "@smithy/smithy-client": "^3.4.5", + "@smithy/types": "^3.7.1", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.10.tgz", + "integrity": "sha512-MnAuhh+dD14F428ubSJuRnmRsfOpxSzvRhaGVTvd/lrUDE3kxzCCmH8lnVTvoNQnV2BbJ4c15QwZ3UdQBtFNZA==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.10.tgz", + "integrity": "sha512-grCHyoiARDBBGPyw2BeicpjgpsDFWZZxptbVKb3CRd/ZA15F/T6rZjCCuBUjJwdck1nwUuIxYtsS4H9DDpbP5w==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.11.tgz", + "integrity": "sha512-URq3gT3RpDikh/8MBJUB+QGZzfS7Bm6TQTqoh4CqE8NBuyPkWa5eUXj0XFcFfeZVgg3WMh1u19iaXn8FvvXxZw==", + "dependencies": { + "@smithy/property-provider": "^3.1.10", + "@smithy/shared-ini-file-loader": "^3.1.11", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.3.1.tgz", + "integrity": "sha512-fr+UAOMGWh6bn4YSEezBCpJn9Ukp9oR4D32sCjCo7U81evE11YePOQ58ogzyfgmjIO79YeOdfXXqr0jyhPQeMg==", + "dependencies": { + "@smithy/abort-controller": "^3.1.8", + "@smithy/protocol-http": "^4.1.7", + "@smithy/querystring-builder": "^3.0.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.10.tgz", + "integrity": "sha512-n1MJZGTorTH2DvyTVj+3wXnd4CzjJxyXeOgnTlgNVFxaaMeT4OteEp4QrzF8p9ee2yg42nvyVK6R/awLCakjeQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.7.tgz", + "integrity": "sha512-FP2LepWD0eJeOTm0SjssPcgqAlDFzOmRXqXmGhfIM52G7Lrox/pcpQf6RP4F21k0+O12zaqQt5fCDOeBtqY6Cg==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.10.tgz", + "integrity": "sha512-nT9CQF3EIJtIUepXQuBFb8dxJi3WVZS3XfuDksxSCSn+/CzZowRLdhDn+2acbBv8R6eaJqPupoI/aRFIImNVPQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "@smithy/util-uri-escape": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.10.tgz", + "integrity": "sha512-Oa0XDcpo9SmjhiDD9ua2UyM3uU01ZTuIrNdZvzwUTykW1PM8o2yJvMh1Do1rY5sUQg4NDV70dMi0JhDx4GyxuQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.10.tgz", + "integrity": "sha512-zHe642KCqDxXLuhs6xmHVgRwy078RfqxP2wRDpIyiF8EmsWXptMwnMwbVa50lw+WOGNrYm9zbaEg0oDe3PTtvQ==", + "dependencies": { + "@smithy/types": "^3.7.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.11.tgz", + "integrity": "sha512-AUdrIZHFtUgmfSN4Gq9nHu3IkHMa1YDcN+s061Nfm+6pQ0mJy85YQDB0tZBCmls0Vuj22pLwDPmL92+Hvfwwlg==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.2.3.tgz", + "integrity": "sha512-pPSQQ2v2vu9vc8iew7sszLd0O09I5TRc5zhY71KA+Ao0xYazIG+uLeHbTJfIWGO3BGVLiXjUr3EEeCcEQLjpWQ==", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-uri-escape": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.4.5.tgz", + "integrity": "sha512-k0sybYT9zlP79sIKd1XGm4TmK0AS1nA2bzDHXx7m0nGi3RQ8dxxQUs4CPkSmQTKAo+KF9aINU3KzpGIpV7UoMw==", + "dependencies": { + "@smithy/core": "^2.5.4", + "@smithy/middleware-endpoint": "^3.2.4", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "@smithy/util-stream": "^3.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.7.1.tgz", + "integrity": "sha512-XKLcLXZY7sUQgvvWyeaL/qwNPp6V3dWcUjqrQKjSb+tzYiCy340R/c64LV5j+Tnb2GhmunEX0eou+L+m2hJNYA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.10.tgz", + "integrity": "sha512-j90NUalTSBR2NaZTuruEgavSdh8MLirf58LoGSk4AtQfyIymogIhgnGUU2Mga2bkMkpSoC9gxb74xBXL5afKAQ==", + "dependencies": { + "@smithy/querystring-parser": "^3.0.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/util-base64": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-3.0.0.tgz", + "integrity": "sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-3.0.0.tgz", + "integrity": "sha512-cbjJs2A1mLYmqmyVl80uoLTJhAcfzMOyPgjwAYusWKMdLeNtzmMz9YxNl3/jRLoxSS3wkqkf0jwNdtXWtyEBaQ==", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-3.0.0.tgz", + "integrity": "sha512-Tj7pZ4bUloNUP6PzwhN7K386tmSmEET9QtQg0TgdNOnxhZvCssHji+oZTUIuzxECRfG8rdm2PMw2WCFs6eIYkA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", + "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-3.0.0.tgz", + "integrity": "sha512-pbjk4s0fwq3Di/ANL+rCvJMKM5bzAQdE5S/6RL5NXgMExFAi6UgQMPOm5yPaIWPpr+EOXKXRonJ3FoxKf4mCJQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.28.tgz", + "integrity": "sha512-6bzwAbZpHRFVJsOztmov5PGDmJYsbNSoIEfHSJJyFLzfBGCCChiO3od9k7E/TLgrCsIifdAbB9nqbVbyE7wRUw==", + "dependencies": { + "@smithy/property-provider": "^3.1.10", + "@smithy/smithy-client": "^3.4.5", + "@smithy/types": "^3.7.1", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.28.tgz", + "integrity": "sha512-78ENJDorV1CjOQselGmm3+z7Yqjj5HWCbjzh0Ixuq736dh1oEnD9sAttSBNSLlpZsX8VQnmERqA2fEFlmqWn8w==", + "dependencies": { + "@smithy/config-resolver": "^3.0.12", + "@smithy/credential-provider-imds": "^3.2.7", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/property-provider": "^3.1.10", + "@smithy/smithy-client": "^3.4.5", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.6.tgz", + "integrity": "sha512-mFV1t3ndBh0yZOJgWxO9J/4cHZVn5UG1D8DeCc6/echfNkeEJWu9LD7mgGH5fHrEdR7LDoWw7PQO6QiGpHXhgA==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz", + "integrity": "sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.10.tgz", + "integrity": "sha512-eJO+/+RsrG2RpmY68jZdwQtnfsxjmPxzMlQpnHKjFPwrYqvlcT+fHdT+ZVwcjlWSrByOhGr9Ff2GG17efc192A==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.10.tgz", + "integrity": "sha512-1l4qatFp4PiU6j7UsbasUHL2VU023NRB/gfaa1M0rDqVrRN4g3mCArLRyH3OuktApA4ye+yjWQHjdziunw2eWA==", + "dependencies": { + "@smithy/service-error-classification": "^3.0.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.3.1.tgz", + "integrity": "sha512-Ff68R5lJh2zj+AUTvbAU/4yx+6QPRzg7+pI7M1FbtQHcRIp7xvguxVsQBKyB3fwiOwhAKu0lnNyYBaQfSW6TNw==", + "dependencies": { + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/types": "^3.7.1", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz", + "integrity": "sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", + "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/@tootallnate/quickjs-emscripten": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", @@ -293,6 +1523,12 @@ "@types/node": "*" } }, + "node_modules/@types/diff": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.3.tgz", + "integrity": "sha512-K0Oqlrq3kQMaO2RhfrNQX5trmt+XLyom88zS0u84nnIcLvFnRUMRRHmrGny5GSM+kNO9IZLARsdQHDzkhAgmrQ==", + "dev": true + }, "node_modules/@types/express": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", @@ -657,6 +1893,11 @@ "node": ">= 0.8" } }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + }, "node_modules/bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", @@ -1023,6 +2264,14 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==" }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/dotenv": { "version": "16.4.6", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.6.tgz", @@ -1330,6 +2579,27 @@ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" }, + "node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -3378,6 +4648,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -3721,9 +4996,35 @@ "zod": "^3.23.3" } }, + "src/aws-kb-retrieval-server": { + "name": "@modelcontextprotocol/server-aws-kb-retrieval", + "version": "0.6.2", + "license": "MIT", + "dependencies": { + "@aws-sdk/client-bedrock-agent-runtime": "^3.0.0", + "@modelcontextprotocol/sdk": "0.5.0" + }, + "bin": { + "mcp-server-aws-kb-retrieval": "dist/index.js" + }, + "devDependencies": { + "@types/node": "^20.10.0", + "shx": "^0.3.4", + "typescript": "^5.6.2" + } + }, + "src/aws-kb-retrieval-server/node_modules/@types/node": { + "version": "20.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.9.tgz", + "integrity": "sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, "src/brave-search": { "name": "@modelcontextprotocol/server-brave-search", - "version": "0.5.2", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1" @@ -3779,7 +5080,7 @@ }, "src/everart": { "name": "@modelcontextprotocol/server-everart", - "version": "0.1.0", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "0.5.0", @@ -3849,7 +5150,7 @@ }, "src/everything": { "name": "@modelcontextprotocol/server-everything", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", @@ -3878,10 +5179,11 @@ }, "src/filesystem": { "name": "@modelcontextprotocol/server-filesystem", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { - "@modelcontextprotocol/sdk": "1.0.1", + "@modelcontextprotocol/sdk": "0.5.0", + "diff": "^5.1.0", "glob": "^10.3.10", "zod-to-json-schema": "^3.23.5" }, @@ -3889,6 +5191,7 @@ "mcp-server-filesystem": "dist/index.js" }, "devDependencies": { + "@types/diff": "^5.0.9", "@types/node": "^20.11.0", "shx": "^0.3.4", "typescript": "^5.3.3" @@ -3960,7 +5263,7 @@ }, "src/gdrive": { "name": "@modelcontextprotocol/server-gdrive", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@google-cloud/local-auth": "^3.0.1", @@ -3997,12 +5300,14 @@ }, "src/github": { "name": "@modelcontextprotocol/server-github", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", + "@types/node": "^20.11.0", "@types/node-fetch": "^2.6.12", "node-fetch": "^3.3.2", + "zod": "^3.22.4", "zod-to-json-schema": "^3.23.5" }, "bin": { @@ -4023,6 +5328,14 @@ "zod": "^3.23.8" } }, + "src/github/node_modules/@types/node": { + "version": "20.17.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.9.tgz", + "integrity": "sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==", + "dependencies": { + "undici-types": "~6.19.2" + } + }, "src/github/node_modules/data-uri-to-buffer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", @@ -4050,7 +5363,7 @@ }, "src/gitlab": { "name": "@modelcontextprotocol/server-gitlab", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", @@ -4103,7 +5416,7 @@ }, "src/google-maps": { "name": "@modelcontextprotocol/server-google-maps", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", @@ -4155,7 +5468,7 @@ }, "src/memory": { "name": "@modelcontextprotocol/server-memory", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1" @@ -4190,7 +5503,7 @@ }, "src/postgres": { "name": "@modelcontextprotocol/server-postgres", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", @@ -4217,7 +5530,7 @@ }, "src/puppeteer": { "name": "@modelcontextprotocol/server-puppeteer", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", @@ -4243,7 +5556,7 @@ }, "src/sequentialthinking": { "name": "@modelcontextprotocol/server-sequential-thinking", - "version": "0.1.0", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "0.5.0", @@ -4271,7 +5584,7 @@ }, "src/slack": { "name": "@modelcontextprotocol/server-slack", - "version": "0.5.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.0.1" diff --git a/package.json b/package.json index 83152ed1..0203ca98 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/servers", "private": true, - "version": "0.6.1", + "version": "0.6.2", "description": "Model Context Protocol servers", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -30,4 +30,4 @@ "@modelcontextprotocol/server-everart": "*", "@modelcontextprotocol/server-sequential-thinking": "*" } -} +} \ No newline at end of file diff --git a/src/aws-kb-retrieval-server/README.md b/src/aws-kb-retrieval-server/README.md new file mode 100644 index 00000000..ac2bdb43 --- /dev/null +++ b/src/aws-kb-retrieval-server/README.md @@ -0,0 +1,53 @@ +# AWS Knowledge Base Retrieval MCP Server + +An MCP server implementation for retrieving information from the AWS Knowledge Base using the Bedrock Agent Runtime. + +## Features + +- **RAG (Retrieval-Augmented Generation)**: Retrieve context from the AWS Knowledge Base based on a query and a Knowledge Base ID. +- **Supports multiple results retrieval**: Option to retrieve a customizable number of results. + +## Tools + +- **retrieve_from_aws_kb** + - Perform retrieval operations using the AWS Knowledge Base. + - Inputs: + - `query` (string): The search query for retrieval. + - `knowledgeBaseId` (string): The ID of the AWS Knowledge Base. + - `n` (number, optional): Number of results to retrieve (default: 3). + +## Configuration + +### Setting up AWS Credentials + +1. Obtain AWS access key ID, secret access key, and region from the AWS Management Console. +2. Ensure these credentials have appropriate permissions for Bedrock Agent Runtime operations. + +### Usage with Claude Desktop + +Add this to your `claude_desktop_config.json`: + +```json +{ + "mcpServers": { + "aws-kb-retrieval": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-aws-kb-retrieval" + ], + "env": { + "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE", + "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE", + "AWS_REGION": "YOUR_AWS_REGION_HERE" + } + } + } +} +``` + +## License + +This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. + +This README assumes that your server package is named `@modelcontextprotocol/server-aws-kb-retrieval`. Adjust the package name and installation details if they differ in your setup. Also, ensure that your server script is correctly built and that all dependencies are properly managed in your `package.json`. diff --git a/src/aws-kb-retrieval-server/index.ts b/src/aws-kb-retrieval-server/index.ts new file mode 100644 index 00000000..f60a544e --- /dev/null +++ b/src/aws-kb-retrieval-server/index.ts @@ -0,0 +1,166 @@ +#!/usr/bin/env node +import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import { + CallToolRequestSchema, + ListToolsRequestSchema, + Tool, +} from "@modelcontextprotocol/sdk/types.js"; +import { + BedrockAgentRuntimeClient, + RetrieveCommand, + RetrieveCommandInput, +} from "@aws-sdk/client-bedrock-agent-runtime"; + +// AWS client initialization +const bedrockClient = new BedrockAgentRuntimeClient({ + region: process.env.AWS_REGION, + credentials: { + accessKeyId: process.env.AWS_ACCESS_KEY_ID!, + secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!, + }, +}); + +interface RAGSource { + id: string; + fileName: string; + snippet: string; + score: number; +} + +async function retrieveContext( + query: string, + knowledgeBaseId: string, + n: number = 3 +): Promise<{ + context: string; + isRagWorking: boolean; + ragSources: RAGSource[]; +}> { + try { + if (!knowledgeBaseId) { + console.error("knowledgeBaseId is not provided"); + return { + context: "", + isRagWorking: false, + ragSources: [], + }; + } + + const input: RetrieveCommandInput = { + knowledgeBaseId: knowledgeBaseId, + retrievalQuery: { text: query }, + retrievalConfiguration: { + vectorSearchConfiguration: { numberOfResults: n }, + }, + }; + + const command = new RetrieveCommand(input); + const response = await bedrockClient.send(command); + const rawResults = response?.retrievalResults || []; + const ragSources: RAGSource[] = rawResults + .filter((res) => res?.content?.text) + .map((result, index) => { + const uri = result?.location?.s3Location?.uri || ""; + const fileName = uri.split("/").pop() || `Source-${index}.txt`; + return { + id: (result.metadata?.["x-amz-bedrock-kb-chunk-id"] as string) || `chunk-${index}`, + fileName: fileName.replace(/_/g, " ").replace(".txt", ""), + snippet: result.content?.text || "", + score: (result.score as number) || 0, + }; + }) + .slice(0, 3); + + const context = rawResults + .filter((res): res is { content: { text: string } } => res?.content?.text !== undefined) + .map(res => res.content.text) + .join("\n\n"); + + return { + context, + isRagWorking: true, + ragSources, + }; + } catch (error) { + console.error("RAG Error:", error); + return { context: "", isRagWorking: false, ragSources: [] }; + } +} + +// Define the retrieval tool +const RETRIEVAL_TOOL: Tool = { + name: "retrieve_from_aws_kb", + description: "Performs retrieval from the AWS Knowledge Base using the provided query and Knowledge Base ID.", + inputSchema: { + type: "object", + properties: { + query: { type: "string", description: "The query to perform retrieval on" }, + knowledgeBaseId: { type: "string", description: "The ID of the AWS Knowledge Base" }, + n: { type: "number", default: 3, description: "Number of results to retrieve" }, + }, + required: ["query", "knowledgeBaseId"], + }, +}; + +// Server setup +const server = new Server( + { + name: "aws-kb-retrieval-server", + version: "0.2.0", + }, + { + capabilities: { + tools: {}, + }, + }, +); + +// Request handlers +server.setRequestHandler(ListToolsRequestSchema, async () => ({ + tools: [RETRIEVAL_TOOL], +})); + +server.setRequestHandler(CallToolRequestSchema, async (request) => { + const { name, arguments: args } = request.params; + + if (name === "retrieve_from_aws_kb") { + const { query, knowledgeBaseId, n = 3 } = args as Record; + try { + const result = await retrieveContext(query, knowledgeBaseId, n); + if (result.isRagWorking) { + return { + content: [ + { type: "text", text: `Context: ${result.context}` }, + { type: "text", text: `RAG Sources: ${JSON.stringify(result.ragSources)}` }, + ], + }; + } else { + return { + content: [{ type: "text", text: "Retrieval failed or returned no results." }], + }; + } + } catch (error) { + return { + content: [{ type: "text", text: `Error occurred: ${error}` }], + }; + } + } else { + return { + content: [{ type: "text", text: `Unknown tool: ${name}` }], + isError: true, + }; + } +}); + +// Server startup +async function runServer() { + const transport = new StdioServerTransport(); + await server.connect(transport); + console.error("AWS KB Retrieval Server running on stdio"); +} + +runServer().catch((error) => { + console.error("Fatal error running server:", error); + process.exit(1); +}); diff --git a/src/aws-kb-retrieval-server/package.json b/src/aws-kb-retrieval-server/package.json new file mode 100644 index 00000000..fdad1a69 --- /dev/null +++ b/src/aws-kb-retrieval-server/package.json @@ -0,0 +1,30 @@ +{ + "name": "@modelcontextprotocol/server-aws-kb-retrieval", + "version": "0.6.2", + "description": "MCP server for AWS Knowledge Base retrieval using Bedrock Agent Runtime", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/servers/issues", + "type": "module", + "bin": { + "mcp-server-aws-kb-retrieval": "dist/index.js" + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsc && shx chmod +x dist/*.js", + "prepare": "npm run build", + "watch": "tsc --watch" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "0.5.0", + "@aws-sdk/client-bedrock-agent-runtime": "^3.0.0" + }, + "devDependencies": { + "@types/node": "^20.10.0", + "shx": "^0.3.4", + "typescript": "^5.6.2" + } +} diff --git a/src/aws-kb-retrieval-server/tsconfig.json b/src/aws-kb-retrieval-server/tsconfig.json new file mode 100644 index 00000000..98b13da0 --- /dev/null +++ b/src/aws-kb-retrieval-server/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": ".", + "composite": true, + "incremental": true, + "tsBuildInfoFile": "./dist/.tsbuildinfo" + }, + "include": [ + "./**/*.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/src/brave-search/package.json b/src/brave-search/package.json index db32735e..70ce9d00 100644 --- a/src/brave-search/package.json +++ b/src/brave-search/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-brave-search", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for Brave Search API integration", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -26,4 +26,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/everart/package.json b/src/everart/package.json index 1496fafe..189ca650 100644 --- a/src/everart/package.json +++ b/src/everart/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-everart", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for EverArt API integration", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -29,4 +29,4 @@ "shx": "^0.3.4", "typescript": "^5.3.3" } -} +} \ No newline at end of file diff --git a/src/everything/package.json b/src/everything/package.json index cc1a12cf..0344f2f1 100644 --- a/src/everything/package.json +++ b/src/everything/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-everything", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server that exercises all the features of the MCP protocol", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -29,4 +29,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/fetch/pyproject.toml b/src/fetch/pyproject.toml index 54a64ee6..1d43cae8 100644 --- a/src/fetch/pyproject.toml +++ b/src/fetch/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcp-server-fetch" -version = "0.6.1" +version = "0.6.2" description = "A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs" readme = "README.md" requires-python = ">=3.10" diff --git a/src/fetch/uv.lock b/src/fetch/uv.lock index 397a1b5b..bb114910 100644 --- a/src/fetch/uv.lock +++ b/src/fetch/uv.lock @@ -327,7 +327,7 @@ wheels = [ [[package]] name = "mcp-server-fetch" -version = "0.1.3" +version = "0.6.2" source = { editable = "." } dependencies = [ { name = "markdownify" }, diff --git a/src/filesystem/README.md b/src/filesystem/README.md index c2950cd5..37bc290f 100644 --- a/src/filesystem/README.md +++ b/src/filesystem/README.md @@ -36,6 +36,30 @@ Node.js server implementing Model Context Protocol (MCP) for filesystem operatio - `path` (string): File location - `content` (string): File content +- **edit_file** + - Make selective edits using advanced pattern matching and formatting + - Features: + - Line-based and multi-line content matching + - Whitespace normalization with indentation preservation + - Fuzzy matching with confidence scoring + - Multiple simultaneous edits with correct positioning + - Indentation style detection and preservation + - Git-style diff output with context + - Preview changes with dry run mode + - Failed match debugging with confidence scores + - Inputs: + - `path` (string): File to edit + - `edits` (array): List of edit operations + - `oldText` (string): Text to search for (can be substring) + - `newText` (string): Text to replace with + - `dryRun` (boolean): Preview changes without applying (default: false) + - `options` (object): Optional formatting settings + - `preserveIndentation` (boolean): Keep existing indentation (default: true) + - `normalizeWhitespace` (boolean): Normalize spaces while preserving structure (default: true) + - `partialMatch` (boolean): Enable fuzzy matching (default: true) + - Returns detailed diff and match information for dry runs, otherwise applies changes + - Best Practice: Always use dryRun first to preview changes before applying them + - **create_directory** - Create new directory or ensure it exists - Input: `path` (string) @@ -98,4 +122,4 @@ Add this to your `claude_desktop_config.json`: ## License -This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. +This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. \ No newline at end of file diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index b4c4e92d..23d989d0 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -12,6 +12,7 @@ import path from "path"; import os from 'os'; import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; +import { diffLines, createTwoFilesPatch } from 'diff'; // Command line argument parsing const args = process.argv.slice(2); @@ -106,6 +107,17 @@ const WriteFileArgsSchema = z.object({ content: z.string(), }); +const EditOperation = z.object({ + oldText: z.string().describe('Text to search for - must match exactly'), + newText: z.string().describe('Text to replace with') +}); + +const EditFileArgsSchema = z.object({ + path: z.string(), + edits: z.array(EditOperation), + dryRun: z.boolean().default(false).describe('Preview changes using git-style diff format') +}); + const CreateDirectoryArgsSchema = z.object({ path: z.string(), }); @@ -202,6 +214,104 @@ async function searchFiles( return results; } +// file editing and diffing utilities +function normalizeLineEndings(text: string): string { + return text.replace(/\r\n/g, '\n'); +} + +function createUnifiedDiff(originalContent: string, newContent: string, filepath: string = 'file'): string { + // Ensure consistent line endings for diff + const normalizedOriginal = normalizeLineEndings(originalContent); + const normalizedNew = normalizeLineEndings(newContent); + + return createTwoFilesPatch( + filepath, + filepath, + normalizedOriginal, + normalizedNew, + 'original', + 'modified' + ); +} + +async function applyFileEdits( + filePath: string, + edits: Array<{oldText: string, newText: string}>, + dryRun = false +): Promise { + // Read file content and normalize line endings + const content = normalizeLineEndings(await fs.readFile(filePath, 'utf-8')); + + // Apply edits sequentially + let modifiedContent = content; + for (const edit of edits) { + const normalizedOld = normalizeLineEndings(edit.oldText); + const normalizedNew = normalizeLineEndings(edit.newText); + + // If exact match exists, use it + if (modifiedContent.includes(normalizedOld)) { + modifiedContent = modifiedContent.replace(normalizedOld, normalizedNew); + continue; + } + + // Otherwise, try line-by-line matching with flexibility for whitespace + const oldLines = normalizedOld.split('\n'); + const contentLines = modifiedContent.split('\n'); + let matchFound = false; + + for (let i = 0; i <= contentLines.length - oldLines.length; i++) { + const potentialMatch = contentLines.slice(i, i + oldLines.length); + + // Compare lines with normalized whitespace + const isMatch = oldLines.every((oldLine, j) => { + const contentLine = potentialMatch[j]; + return oldLine.trim() === contentLine.trim(); + }); + + if (isMatch) { + // Preserve original indentation of first line + const originalIndent = contentLines[i].match(/^\s*/)?.[0] || ''; + const newLines = normalizedNew.split('\n').map((line, j) => { + if (j === 0) return originalIndent + line.trimStart(); + // For subsequent lines, try to preserve relative indentation + const oldIndent = oldLines[j]?.match(/^\s*/)?.[0] || ''; + const newIndent = line.match(/^\s*/)?.[0] || ''; + if (oldIndent && newIndent) { + const relativeIndent = newIndent.length - oldIndent.length; + return originalIndent + ' '.repeat(Math.max(0, relativeIndent)) + line.trimStart(); + } + return line; + }); + + contentLines.splice(i, oldLines.length, ...newLines); + modifiedContent = contentLines.join('\n'); + matchFound = true; + break; + } + } + + if (!matchFound) { + throw new Error(`Could not find exact match for edit:\n${edit.oldText}`); + } + } + + // Create unified diff + const diff = createUnifiedDiff(content, modifiedContent, filePath); + + // Format diff with appropriate number of backticks + let numBackticks = 3; + while (diff.includes('`'.repeat(numBackticks))) { + numBackticks++; + } + const formattedDiff = `${'`'.repeat(numBackticks)}diff\n${diff}${'`'.repeat(numBackticks)}\n\n`; + + if (!dryRun) { + await fs.writeFile(filePath, modifiedContent, 'utf-8'); + } + + return formattedDiff; +} + // Tool handlers server.setRequestHandler(ListToolsRequestSchema, async () => { return { @@ -233,6 +343,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => { "Handles text content with proper encoding. Only works within allowed directories.", inputSchema: zodToJsonSchema(WriteFileArgsSchema) as ToolInput, }, + { + name: "edit_file", + description: + "Make line-based edits to a text file. Each edit replaces exact line sequences " + + "with new content. Returns a git-style diff showing the changes made. " + + "Only works within allowed directories.", + inputSchema: zodToJsonSchema(EditFileArgsSchema) as ToolInput, + }, { name: "create_directory", description: @@ -346,6 +464,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } + case "edit_file": { + const parsed = EditFileArgsSchema.safeParse(args); + if (!parsed.success) { + throw new Error(`Invalid arguments for edit_file: ${parsed.error}`); + } + const validPath = await validatePath(parsed.data.path); + const result = await applyFileEdits(validPath, parsed.data.edits, parsed.data.dryRun); + return { + content: [{ type: "text", text: result }], + }; + } + case "create_directory": { const parsed = CreateDirectoryArgsSchema.safeParse(args); if (!parsed.success) { diff --git a/src/filesystem/package.json b/src/filesystem/package.json index ec650cb5..bb9797ce 100644 --- a/src/filesystem/package.json +++ b/src/filesystem/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-filesystem", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for filesystem access", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -19,13 +19,15 @@ "watch": "tsc --watch" }, "dependencies": { - "@modelcontextprotocol/sdk": "1.0.1", + "@modelcontextprotocol/sdk": "0.5.0", + "diff": "^5.1.0", "glob": "^10.3.10", "zod-to-json-schema": "^3.23.5" }, "devDependencies": { + "@types/diff": "^5.0.9", "@types/node": "^20.11.0", "shx": "^0.3.4", "typescript": "^5.3.3" } -} +} \ No newline at end of file diff --git a/src/gdrive/package.json b/src/gdrive/package.json index ddea3a19..26e2bfe5 100644 --- a/src/gdrive/package.json +++ b/src/gdrive/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-gdrive", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for interacting with Google Drive", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -28,4 +28,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/git/pyproject.toml b/src/git/pyproject.toml index 1356858b..373529c0 100644 --- a/src/git/pyproject.toml +++ b/src/git/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcp-server-git" -version = "0.6.1" +version = "0.6.2" description = "A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs" readme = "README.md" requires-python = ">=3.10" diff --git a/src/git/uv.lock b/src/git/uv.lock index 3411aa00..4b585e9a 100644 --- a/src/git/uv.lock +++ b/src/git/uv.lock @@ -146,7 +146,7 @@ wheels = [ [[package]] name = "mcp" -version = "0.9.1" +version = "1.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -156,14 +156,14 @@ dependencies = [ { name = "sse-starlette" }, { name = "starlette" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e7/1c/932818470ffd49c33509110c835101a8dc4c9cdd06028b9f647fb3dde237/mcp-0.9.1.tar.gz", hash = "sha256:e8509a37c2ab546095788ed170e0fb4d7ce0cf5a3ee56b6449c78af27321a425", size = 78218 } +sdist = { url = "https://files.pythonhosted.org/packages/77/f2/067b1fc114e8d3ae4af02fc4f4ed8971a2c4900362d976fabe0f4e9a3418/mcp-1.1.0.tar.gz", hash = "sha256:e3c8d6df93a4de90230ea944dd667730744a3cd91a4cc0ee66a5acd53419e100", size = 83802 } wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/a0/2ee813d456b57a726d583868417d1ad900fbe12ee3c8cd866e3e804ca486/mcp-0.9.1-py3-none-any.whl", hash = "sha256:7f640fcfb0be486aa510594df309920ae1d375cdca1f8aff21db3a96d837f303", size = 31562 }, + { url = "https://files.pythonhosted.org/packages/b9/3e/aef19ac08a6f9a347c086c4e628c2f7329659828cbe92ffd524ec2aac833/mcp-1.1.0-py3-none-any.whl", hash = "sha256:44aa4d2e541f0924d6c344aa7f96b427a6ee1df2fab70b5f9ae2f8777b3f05f2", size = 36576 }, ] [[package]] name = "mcp-server-git" -version = "0.4.1" +version = "0.6.2" source = { editable = "." } dependencies = [ { name = "click" }, @@ -182,7 +182,7 @@ dev = [ requires-dist = [ { name = "click", specifier = ">=8.1.7" }, { name = "gitpython", specifier = ">=3.1.43" }, - { name = "mcp", specifier = ">=0.6.0" }, + { name = "mcp", specifier = ">=1.0.0" }, { name = "pydantic", specifier = ">=2.0.0" }, ] diff --git a/src/github/README.md b/src/github/README.md index de29874c..cc0a09c3 100644 --- a/src/github/README.md +++ b/src/github/README.md @@ -1,6 +1,6 @@ # GitHub MCP Server -MCP Server for the GitHub API, enabling file operations, repository management, and more. +MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more. ### Features @@ -8,6 +8,7 @@ MCP Server for the GitHub API, enabling file operations, repository management, - **Comprehensive Error Handling**: Clear error messages for common issues - **Git History Preservation**: Operations maintain proper Git history without force pushing - **Batch Operations**: Support for both single-file and multi-file operations +- **Advanced Search**: Support for searching code, issues/PRs, and users ## Tools @@ -102,7 +103,74 @@ MCP Server for the GitHub API, enabling file operations, repository management, - `from_branch` (optional string): Source branch (defaults to repo default) - Returns: Created branch reference -10. `list_commits` +10. `list_issues` + - List and filter repository issues + - Inputs: + - `owner` (string): Repository owner + - `repo` (string): Repository name + - `state` (optional string): Filter by state ('open', 'closed', 'all') + - `labels` (optional string[]): Filter by labels + - `sort` (optional string): Sort by ('created', 'updated', 'comments') + - `direction` (optional string): Sort direction ('asc', 'desc') + - `since` (optional string): Filter by date (ISO 8601 timestamp) + - `page` (optional number): Page number + - `per_page` (optional number): Results per page + - Returns: Array of issue details + +11. `update_issue` + - Update an existing issue + - Inputs: + - `owner` (string): Repository owner + - `repo` (string): Repository name + - `issue_number` (number): Issue number to update + - `title` (optional string): New title + - `body` (optional string): New description + - `state` (optional string): New state ('open' or 'closed') + - `labels` (optional string[]): New labels + - `assignees` (optional string[]): New assignees + - `milestone` (optional number): New milestone number + - Returns: Updated issue details + +12. `add_issue_comment` + - Add a comment to an issue + - Inputs: + - `owner` (string): Repository owner + - `repo` (string): Repository name + - `issue_number` (number): Issue number to comment on + - `body` (string): Comment text + - Returns: Created comment details + +13. `search_code` + - Search for code across GitHub repositories + - Inputs: + - `q` (string): Search query using GitHub code search syntax + - `sort` (optional string): Sort field ('indexed' only) + - `order` (optional string): Sort order ('asc' or 'desc') + - `per_page` (optional number): Results per page (max 100) + - `page` (optional number): Page number + - Returns: Code search results with repository context + +14. `search_issues` + - Search for issues and pull requests + - Inputs: + - `q` (string): Search query using GitHub issues search syntax + - `sort` (optional string): Sort field (comments, reactions, created, etc.) + - `order` (optional string): Sort order ('asc' or 'desc') + - `per_page` (optional number): Results per page (max 100) + - `page` (optional number): Page number + - Returns: Issue and pull request search results + +15. `search_users` + - Search for GitHub users + - Inputs: + - `q` (string): Search query using GitHub users search syntax + - `sort` (optional string): Sort field (followers, repositories, joined) + - `order` (optional string): Sort order ('asc' or 'desc') + - `per_page` (optional number): Results per page (max 100) + - `page` (optional number): Page number + - Returns: User search results + +16. `list_commits` - Gets commits of a branch in a repository - Inputs: - `owner` (string): Repository owner @@ -112,6 +180,30 @@ MCP Server for the GitHub API, enabling file operations, repository management, - `sha` (optional string): branch name - Returns: List of commits +## Search Query Syntax + +### Code Search +- `language:javascript`: Search by programming language +- `repo:owner/name`: Search in specific repository +- `path:app/src`: Search in specific path +- `extension:js`: Search by file extension +- Example: `q: "import express" language:typescript path:src/` + +### Issues Search +- `is:issue` or `is:pr`: Filter by type +- `is:open` or `is:closed`: Filter by state +- `label:bug`: Search by label +- `author:username`: Search by author +- Example: `q: "memory leak" is:issue is:open label:bug` + +### Users Search +- `type:user` or `type:org`: Filter by account type +- `followers:>1000`: Filter by followers +- `location:London`: Search by location +- Example: `q: "fullstack developer" location:London followers:>100` + +For detailed search syntax, see [GitHub's searching documentation](https://docs.github.com/en/search-github/searching-on-github). + ## Setup ### Personal Access Token diff --git a/src/github/index.ts b/src/github/index.ts index 66cae6a1..287cfdcb 100644 --- a/src/github/index.ts +++ b/src/github/index.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node - import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { @@ -7,56 +6,71 @@ import { ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js"; import fetch from "node-fetch"; -import { - GitHubForkSchema, - GitHubReferenceSchema, - GitHubRepositorySchema, - GitHubIssueSchema, - GitHubPullRequestSchema, - GitHubContentSchema, - GitHubCreateUpdateFileResponseSchema, - GitHubSearchResponseSchema, - GitHubTreeSchema, - GitHubCommitSchema, - GitHubListCommitsSchema, - CreateRepositoryOptionsSchema, - CreateIssueOptionsSchema, - CreatePullRequestOptionsSchema, - CreateBranchOptionsSchema, - type GitHubFork, - type GitHubReference, - type GitHubRepository, - type GitHubIssue, - type GitHubPullRequest, - type GitHubContent, - type GitHubCreateUpdateFileResponse, - type GitHubSearchResponse, - type GitHubTree, - type GitHubCommit, - type FileOperation, - CreateOrUpdateFileSchema, - SearchRepositoriesSchema, - CreateRepositorySchema, - GetFileContentsSchema, - PushFilesSchema, - CreateIssueSchema, - CreatePullRequestSchema, - ForkRepositorySchema, - CreateBranchSchema, - ListCommitsSchema, - GitHubListCommits -} from './schemas.js'; import { z } from 'zod'; import { zodToJsonSchema } from 'zod-to-json-schema'; +import { + CreateBranchOptionsSchema, + CreateBranchSchema, + CreateIssueOptionsSchema, + CreateIssueSchema, + CreateOrUpdateFileSchema, + CreatePullRequestOptionsSchema, + CreatePullRequestSchema, + CreateRepositoryOptionsSchema, + CreateRepositorySchema, + ForkRepositorySchema, + GetFileContentsSchema, + GitHubCommitSchema, + GitHubContentSchema, + GitHubCreateUpdateFileResponseSchema, + GitHubForkSchema, + GitHubIssueSchema, + GitHubListCommits, + GitHubListCommitsSchema, + GitHubPullRequestSchema, + GitHubReferenceSchema, + GitHubRepositorySchema, + GitHubSearchResponseSchema, + GitHubTreeSchema, + IssueCommentSchema, + ListCommitsSchema, + ListIssuesOptionsSchema, + PushFilesSchema, + SearchCodeResponseSchema, + SearchCodeSchema, + SearchIssuesResponseSchema, + SearchIssuesSchema, + SearchRepositoriesSchema, + SearchUsersResponseSchema, + SearchUsersSchema, + UpdateIssueOptionsSchema, + type FileOperation, + type GitHubCommit, + type GitHubContent, + type GitHubCreateUpdateFileResponse, + type GitHubFork, + type GitHubIssue, + type GitHubPullRequest, + type GitHubReference, + type GitHubRepository, + type GitHubSearchResponse, + type GitHubTree, + type SearchCodeResponse, + type SearchIssuesResponse, + type SearchUsersResponse +} from './schemas.js'; -const server = new Server({ - name: "github-mcp-server", - version: "0.1.0", -}, { - capabilities: { - tools: {} +const server = new Server( + { + name: "github-mcp-server", + version: "0.1.0", + }, + { + capabilities: { + tools: {}, + }, } -}); +); const GITHUB_PERSONAL_ACCESS_TOKEN = process.env.GITHUB_PERSONAL_ACCESS_TOKEN; @@ -70,17 +84,17 @@ async function forkRepository( repo: string, organization?: string ): Promise { - const url = organization + const url = organization ? `https://api.github.com/repos/${owner}/${repo}/forks?organization=${organization}` : `https://api.github.com/repos/${owner}/${repo}/forks`; const response = await fetch(url, { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, }); if (!response.ok) { @@ -96,21 +110,21 @@ async function createBranch( options: z.infer ): Promise { const fullRef = `refs/heads/${options.ref}`; - + const response = await fetch( `https://api.github.com/repos/${owner}/${repo}/git/refs`, { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, body: JSON.stringify({ ref: fullRef, - sha: options.sha - }) + sha: options.sha, + }), } ); @@ -129,10 +143,10 @@ async function getDefaultBranchSHA( `https://api.github.com/repos/${owner}/${repo}/git/refs/heads/main`, { headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, } ); @@ -141,15 +155,17 @@ async function getDefaultBranchSHA( `https://api.github.com/repos/${owner}/${repo}/git/refs/heads/master`, { headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, } ); if (!masterResponse.ok) { - throw new Error("Could not find default branch (tried 'main' and 'master')"); + throw new Error( + "Could not find default branch (tried 'main' and 'master')" + ); } const data = GitHubReferenceSchema.parse(await masterResponse.json()); @@ -173,10 +189,10 @@ async function getFileContents( const response = await fetch(url, { headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, }); if (!response.ok) { @@ -187,7 +203,7 @@ async function getFileContents( // If it's a file, decode the content if (!Array.isArray(data) && data.content) { - data.content = Buffer.from(data.content, 'base64').toString('utf8'); + data.content = Buffer.from(data.content, "base64").toString("utf8"); } return data; @@ -203,12 +219,12 @@ async function createIssue( { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, - body: JSON.stringify(options) + body: JSON.stringify(options), } ); @@ -229,12 +245,12 @@ async function createPullRequest( { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, - body: JSON.stringify(options) + body: JSON.stringify(options), } ); @@ -254,7 +270,7 @@ async function createOrUpdateFile( branch: string, sha?: string ): Promise { - const encodedContent = Buffer.from(content).toString('base64'); + const encodedContent = Buffer.from(content).toString("base64"); let currentSha = sha; if (!currentSha) { @@ -264,28 +280,30 @@ async function createOrUpdateFile( currentSha = existingFile.sha; } } catch (error) { - console.error('Note: File does not exist in branch, will create new file'); + console.error( + "Note: File does not exist in branch, will create new file" + ); } } const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`; - + const body = { message, content: encodedContent, branch, - ...(currentSha ? { sha: currentSha } : {}) + ...(currentSha ? { sha: currentSha } : {}), }; const response = await fetch(url, { method: "PUT", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, - body: JSON.stringify(body) + body: JSON.stringify(body), }); if (!response.ok) { @@ -301,11 +319,11 @@ async function createTree( files: FileOperation[], baseTree?: string ): Promise { - const tree = files.map(file => ({ + const tree = files.map((file) => ({ path: file.path, - mode: '100644' as const, - type: 'blob' as const, - content: file.content + mode: "100644" as const, + type: "blob" as const, + content: file.content, })); const response = await fetch( @@ -313,15 +331,15 @@ async function createTree( { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, body: JSON.stringify({ tree, - base_tree: baseTree - }) + base_tree: baseTree, + }), } ); @@ -344,16 +362,16 @@ async function createCommit( { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, body: JSON.stringify({ message, tree, - parents - }) + parents, + }), } ); @@ -375,15 +393,15 @@ async function updateReference( { method: "PATCH", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, body: JSON.stringify({ sha, - force: true - }) + force: true, + }), } ); @@ -405,10 +423,10 @@ async function pushFiles( `https://api.github.com/repos/${owner}/${repo}/git/refs/heads/${branch}`, { headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, } ); @@ -420,7 +438,9 @@ async function pushFiles( const commitSha = ref.object.sha; const tree = await createTree(owner, repo, files, commitSha); - const commit = await createCommit(owner, repo, message, tree.sha, [commitSha]); + const commit = await createCommit(owner, repo, message, tree.sha, [ + commitSha, + ]); return await updateReference(owner, repo, `heads/${branch}`, commit.sha); } @@ -436,10 +456,10 @@ async function searchRepositories( const response = await fetch(url.toString(), { headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, }); if (!response.ok) { @@ -455,12 +475,12 @@ async function createRepository( const response = await fetch("https://api.github.com/user/repos", { method: "POST", headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", "User-Agent": "github-mcp-server", - "Content-Type": "application/json" + "Content-Type": "application/json", }, - body: JSON.stringify(options) + body: JSON.stringify(options), }); if (!response.ok) { @@ -480,10 +500,10 @@ async function listCommits( const url = new URL(`https://api.github.com/repos/${owner}/${repo}/commits`); url.searchParams.append("page", page.toString()); url.searchParams.append("per_page", perPage.toString()); - if (sha) { + if (sha) { url.searchParams.append("sha", sha); } - + const response = await fetch( url.toString(), { @@ -504,60 +524,261 @@ async function listCommits( return GitHubListCommitsSchema.parse(await response.json()); } +async function listIssues( + owner: string, + repo: string, + options: Omit, 'owner' | 'repo'> +): Promise { + const url = new URL(`https://api.github.com/repos/${owner}/${repo}/issues`); + + // Add query parameters + if (options.state) url.searchParams.append('state', options.state); + if (options.labels) url.searchParams.append('labels', options.labels.join(',')); + if (options.sort) url.searchParams.append('sort', options.sort); + if (options.direction) url.searchParams.append('direction', options.direction); + if (options.since) url.searchParams.append('since', options.since); + if (options.page) url.searchParams.append('page', options.page.toString()); + if (options.per_page) url.searchParams.append('per_page', options.per_page.toString()); + + const response = await fetch(url.toString(), { + headers: { + "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + "Accept": "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server" + } + }); + + if (!response.ok) { + throw new Error(`GitHub API error: ${response.statusText}`); + } + + return z.array(GitHubIssueSchema).parse(await response.json()); +} + +async function updateIssue( + owner: string, + repo: string, + issueNumber: number, + options: Omit, 'owner' | 'repo' | 'issue_number'> +): Promise { + const response = await fetch( + `https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}`, + { + method: "PATCH", + headers: { + "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + "Accept": "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + title: options.title, + body: options.body, + state: options.state, + labels: options.labels, + assignees: options.assignees, + milestone: options.milestone + }) + } + ); + + if (!response.ok) { + throw new Error(`GitHub API error: ${response.statusText}`); + } + + return GitHubIssueSchema.parse(await response.json()); +} + +async function addIssueComment( + owner: string, + repo: string, + issueNumber: number, + body: string +): Promise> { + const response = await fetch( + `https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}/comments`, + { + method: "POST", + headers: { + "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + "Accept": "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + "Content-Type": "application/json" + }, + body: JSON.stringify({ body }) + } + ); + + if (!response.ok) { + throw new Error(`GitHub API error: ${response.statusText}`); + } + + return IssueCommentSchema.parse(await response.json()); +} + +async function searchCode( + params: z.infer +): Promise { + const url = new URL("https://api.github.com/search/code"); + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + url.searchParams.append(key, value.toString()); + } + }); + + const response = await fetch(url.toString(), { + headers: { + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, + }); + + if (!response.ok) { + throw new Error(`GitHub API error: ${response.statusText}`); + } + + return SearchCodeResponseSchema.parse(await response.json()); +} + +async function searchIssues( + params: z.infer +): Promise { + const url = new URL("https://api.github.com/search/issues"); + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + url.searchParams.append(key, value.toString()); + } + }); + + const response = await fetch(url.toString(), { + headers: { + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, + }); + + if (!response.ok) { + throw new Error(`GitHub API error: ${response.statusText}`); + } + + return SearchIssuesResponseSchema.parse(await response.json()); +} + +async function searchUsers( + params: z.infer +): Promise { + const url = new URL("https://api.github.com/search/users"); + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + url.searchParams.append(key, value.toString()); + } + }); + + const response = await fetch(url.toString(), { + headers: { + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, + }); + + if (!response.ok) { + throw new Error(`GitHub API error: ${response.statusText}`); + } + + return SearchUsersResponseSchema.parse(await response.json()); +} + server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "create_or_update_file", description: "Create or update a single file in a GitHub repository", - inputSchema: zodToJsonSchema(CreateOrUpdateFileSchema) + inputSchema: zodToJsonSchema(CreateOrUpdateFileSchema), }, { name: "search_repositories", description: "Search for GitHub repositories", - inputSchema: zodToJsonSchema(SearchRepositoriesSchema) + inputSchema: zodToJsonSchema(SearchRepositoriesSchema), }, { name: "create_repository", description: "Create a new GitHub repository in your account", - inputSchema: zodToJsonSchema(CreateRepositorySchema) + inputSchema: zodToJsonSchema(CreateRepositorySchema), }, { name: "get_file_contents", - description: "Get the contents of a file or directory from a GitHub repository", - inputSchema: zodToJsonSchema(GetFileContentsSchema) + description: + "Get the contents of a file or directory from a GitHub repository", + inputSchema: zodToJsonSchema(GetFileContentsSchema), }, { name: "push_files", - description: "Push multiple files to a GitHub repository in a single commit", - inputSchema: zodToJsonSchema(PushFilesSchema) + description: + "Push multiple files to a GitHub repository in a single commit", + inputSchema: zodToJsonSchema(PushFilesSchema), }, { name: "create_issue", description: "Create a new issue in a GitHub repository", - inputSchema: zodToJsonSchema(CreateIssueSchema) + inputSchema: zodToJsonSchema(CreateIssueSchema), }, { name: "create_pull_request", description: "Create a new pull request in a GitHub repository", - inputSchema: zodToJsonSchema(CreatePullRequestSchema) + inputSchema: zodToJsonSchema(CreatePullRequestSchema), }, { name: "fork_repository", - description: "Fork a GitHub repository to your account or specified organization", - inputSchema: zodToJsonSchema(ForkRepositorySchema) + description: + "Fork a GitHub repository to your account or specified organization", + inputSchema: zodToJsonSchema(ForkRepositorySchema), }, { name: "create_branch", description: "Create a new branch in a GitHub repository", - inputSchema: zodToJsonSchema(CreateBranchSchema) + inputSchema: zodToJsonSchema(CreateBranchSchema), }, { name: "list_commits", description: "Get list of commits of a branch in a GitHub repository", inputSchema: zodToJsonSchema(ListCommitsSchema) - } - ] + }, + { + name: "list_issues", + description: "List issues in a GitHub repository with filtering options", + inputSchema: zodToJsonSchema(ListIssuesOptionsSchema) + }, + { + name: "update_issue", + description: "Update an existing issue in a GitHub repository", + inputSchema: zodToJsonSchema(UpdateIssueOptionsSchema) + }, + { + name: "add_issue_comment", + description: "Add a comment to an existing issue", + inputSchema: zodToJsonSchema(IssueCommentSchema) + }, + { + name: "search_code", + description: "Search for code across GitHub repositories", + inputSchema: zodToJsonSchema(SearchCodeSchema), + }, + { + name: "search_issues", + description: + "Search for issues and pull requests across GitHub repositories", + inputSchema: zodToJsonSchema(SearchIssuesSchema), + }, + { + name: "search_users", + description: "Search for users on GitHub", + inputSchema: zodToJsonSchema(SearchUsersSchema), + }, + ], }; }); @@ -570,8 +791,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { switch (request.params.name) { case "fork_repository": { const args = ForkRepositorySchema.parse(request.params.arguments); - const fork = await forkRepository(args.owner, args.repo, args.organization); - return { content: [{ type: "text", text: JSON.stringify(fork, null, 2) }] }; + const fork = await forkRepository( + args.owner, + args.repo, + args.organization + ); + return { + content: [{ type: "text", text: JSON.stringify(fork, null, 2) }], + }; } case "create_branch": { @@ -582,10 +809,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { `https://api.github.com/repos/${args.owner}/${args.repo}/git/refs/heads/${args.from_branch}`, { headers: { - "Authorization": `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, - "Accept": "application/vnd.github.v3+json", - "User-Agent": "github-mcp-server" - } + Authorization: `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`, + Accept: "application/vnd.github.v3+json", + "User-Agent": "github-mcp-server", + }, } ); @@ -601,28 +828,47 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { const branch = await createBranch(args.owner, args.repo, { ref: args.branch, - sha + sha, }); - return { content: [{ type: "text", text: JSON.stringify(branch, null, 2) }] }; + return { + content: [{ type: "text", text: JSON.stringify(branch, null, 2) }], + }; } case "search_repositories": { const args = SearchRepositoriesSchema.parse(request.params.arguments); - const results = await searchRepositories(args.query, args.page, args.perPage); - return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] }; + const results = await searchRepositories( + args.query, + args.page, + args.perPage + ); + return { + content: [{ type: "text", text: JSON.stringify(results, null, 2) }], + }; } case "create_repository": { const args = CreateRepositorySchema.parse(request.params.arguments); const repository = await createRepository(args); - return { content: [{ type: "text", text: JSON.stringify(repository, null, 2) }] }; + return { + content: [ + { type: "text", text: JSON.stringify(repository, null, 2) }, + ], + }; } case "get_file_contents": { const args = GetFileContentsSchema.parse(request.params.arguments); - const contents = await getFileContents(args.owner, args.repo, args.path, args.branch); - return { content: [{ type: "text", text: JSON.stringify(contents, null, 2) }] }; + const contents = await getFileContents( + args.owner, + args.repo, + args.path, + args.branch + ); + return { + content: [{ type: "text", text: JSON.stringify(contents, null, 2) }], + }; } case "create_or_update_file": { @@ -636,7 +882,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { args.branch, args.sha ); - return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; + return { + content: [{ type: "text", text: JSON.stringify(result, null, 2) }], + }; } case "push_files": { @@ -648,21 +896,74 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { args.files, args.message ); - return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; + return { + content: [{ type: "text", text: JSON.stringify(result, null, 2) }], + }; } case "create_issue": { const args = CreateIssueSchema.parse(request.params.arguments); const { owner, repo, ...options } = args; const issue = await createIssue(owner, repo, options); - return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }] }; + return { + content: [{ type: "text", text: JSON.stringify(issue, null, 2) }], + }; } case "create_pull_request": { const args = CreatePullRequestSchema.parse(request.params.arguments); const { owner, repo, ...options } = args; const pullRequest = await createPullRequest(owner, repo, options); - return { content: [{ type: "text", text: JSON.stringify(pullRequest, null, 2) }] }; + return { + content: [ + { type: "text", text: JSON.stringify(pullRequest, null, 2) }, + ], + }; + } + + case "search_code": { + const args = SearchCodeSchema.parse(request.params.arguments); + const results = await searchCode(args); + return { + content: [{ type: "text", text: JSON.stringify(results, null, 2) }], + }; + } + + case "search_issues": { + const args = SearchIssuesSchema.parse(request.params.arguments); + const results = await searchIssues(args); + return { + content: [{ type: "text", text: JSON.stringify(results, null, 2) }], + }; + } + + case "search_users": { + const args = SearchUsersSchema.parse(request.params.arguments); + const results = await searchUsers(args); + return { + content: [{ type: "text", text: JSON.stringify(results, null, 2) }], + }; + } + + case "list_issues": { + const args = ListIssuesOptionsSchema.parse(request.params.arguments); + const { owner, repo, ...options } = args; + const issues = await listIssues(owner, repo, options); + return { toolResult: issues }; + } + + case "update_issue": { + const args = UpdateIssueOptionsSchema.parse(request.params.arguments); + const { owner, repo, issue_number, ...options } = args; + const issue = await updateIssue(owner, repo, issue_number, options); + return { toolResult: issue }; + } + + case "add_issue_comment": { + const args = IssueCommentSchema.parse(request.params.arguments); + const { owner, repo, issue_number, body } = args; + const comment = await addIssueComment(owner, repo, issue_number, body); + return { toolResult: comment }; } case "list_commits": { @@ -676,7 +977,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } } catch (error) { if (error instanceof z.ZodError) { - throw new Error(`Invalid arguments: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`); + throw new Error( + `Invalid arguments: ${error.errors + .map( + (e: z.ZodError["errors"][number]) => + `${e.path.join(".")}: ${e.message}` + ) + .join(", ")}` + ); } throw error; } @@ -691,4 +999,4 @@ async function runServer() { runServer().catch((error) => { console.error("Fatal error in main():", error); process.exit(1); -}); \ No newline at end of file +}); diff --git a/src/github/package.json b/src/github/package.json index fc85c6bc..0fc2aaeb 100644 --- a/src/github/package.json +++ b/src/github/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-github", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for using the GitHub API", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -20,12 +20,14 @@ }, "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", + "@types/node": "^20.11.0", "@types/node-fetch": "^2.6.12", "node-fetch": "^3.3.2", + "zod": "^3.22.4", "zod-to-json-schema": "^3.23.5" }, "devDependencies": { "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/github/schemas.ts b/src/github/schemas.ts index ad9f30c8..69ad9443 100644 --- a/src/github/schemas.ts +++ b/src/github/schemas.ts @@ -1,10 +1,10 @@ -import { z } from 'zod'; +import { z } from "zod"; // Base schemas for common types export const GitHubAuthorSchema = z.object({ name: z.string(), email: z.string(), - date: z.string() + date: z.string(), }); // Repository related schemas @@ -15,7 +15,7 @@ export const GitHubOwnerSchema = z.object({ avatar_url: z.string(), url: z.string(), html_url: z.string(), - type: z.string() + type: z.string(), }); export const GitHubRepositorySchema = z.object({ @@ -35,7 +35,7 @@ export const GitHubRepositorySchema = z.object({ git_url: z.string(), ssh_url: z.string(), clone_url: z.string(), - default_branch: z.string() + default_branch: z.string(), }); // File content schemas @@ -50,7 +50,7 @@ export const GitHubFileContentSchema = z.object({ url: z.string(), git_url: z.string(), html_url: z.string(), - download_url: z.string() + download_url: z.string(), }); export const GitHubDirectoryContentSchema = z.object({ @@ -62,35 +62,35 @@ export const GitHubDirectoryContentSchema = z.object({ url: z.string(), git_url: z.string(), html_url: z.string(), - download_url: z.string().nullable() + download_url: z.string().nullable(), }); export const GitHubContentSchema = z.union([ GitHubFileContentSchema, - z.array(GitHubDirectoryContentSchema) + z.array(GitHubDirectoryContentSchema), ]); // Operation schemas export const FileOperationSchema = z.object({ path: z.string(), - content: z.string() + content: z.string(), }); // Tree and commit schemas export const GitHubTreeEntrySchema = z.object({ path: z.string(), - mode: z.enum(['100644', '100755', '040000', '160000', '120000']), - type: z.enum(['blob', 'tree', 'commit']), + mode: z.enum(["100644", "100755", "040000", "160000", "120000"]), + type: z.enum(["blob", "tree", "commit"]), size: z.number().optional(), sha: z.string(), - url: z.string() + url: z.string(), }); export const GitHubTreeSchema = z.object({ sha: z.string(), url: z.string(), tree: z.array(GitHubTreeEntrySchema), - truncated: z.boolean() + truncated: z.boolean(), }); export const GitHubListCommitsSchema = z.array(z.object({ @@ -121,12 +121,14 @@ export const GitHubCommitSchema = z.object({ message: z.string(), tree: z.object({ sha: z.string(), - url: z.string() + url: z.string(), }), - parents: z.array(z.object({ - sha: z.string(), - url: z.string() - })) + parents: z.array( + z.object({ + sha: z.string(), + url: z.string(), + }) + ), }); // Reference schema @@ -137,8 +139,8 @@ export const GitHubReferenceSchema = z.object({ object: z.object({ sha: z.string(), type: z.string(), - url: z.string() - }) + url: z.string(), + }), }); // Input schemas for operations @@ -146,7 +148,7 @@ export const CreateRepositoryOptionsSchema = z.object({ name: z.string(), description: z.string().optional(), private: z.boolean().optional(), - auto_init: z.boolean().optional() + auto_init: z.boolean().optional(), }); export const CreateIssueOptionsSchema = z.object({ @@ -154,7 +156,7 @@ export const CreateIssueOptionsSchema = z.object({ body: z.string().optional(), assignees: z.array(z.string()).optional(), milestone: z.number().optional(), - labels: z.array(z.string()).optional() + labels: z.array(z.string()).optional(), }); export const CreatePullRequestOptionsSchema = z.object({ @@ -163,12 +165,12 @@ export const CreatePullRequestOptionsSchema = z.object({ head: z.string(), base: z.string(), maintainer_can_modify: z.boolean().optional(), - draft: z.boolean().optional() + draft: z.boolean().optional(), }); export const CreateBranchOptionsSchema = z.object({ ref: z.string(), - sha: z.string() + sha: z.string(), }); // Response schemas for operations @@ -183,21 +185,23 @@ export const GitHubCreateUpdateFileResponseSchema = z.object({ committer: GitHubAuthorSchema, message: z.string(), tree: z.object({ - sha: z.string(), - url: z.string() - }), - parents: z.array(z.object({ sha: z.string(), url: z.string(), - html_url: z.string() - })) - }) + }), + parents: z.array( + z.object({ + sha: z.string(), + url: z.string(), + html_url: z.string(), + }) + ), + }), }); export const GitHubSearchResponseSchema = z.object({ total_count: z.number(), incomplete_results: z.boolean(), - items: z.array(GitHubRepositorySchema) + items: z.array(GitHubRepositorySchema), }); // Fork related schemas @@ -207,14 +211,14 @@ export const GitHubForkParentSchema = z.object({ owner: z.object({ login: z.string(), id: z.number(), - avatar_url: z.string() + avatar_url: z.string(), }), - html_url: z.string() + html_url: z.string(), }); export const GitHubForkSchema = GitHubRepositorySchema.extend({ parent: GitHubForkParentSchema, - source: GitHubForkParentSchema + source: GitHubForkParentSchema, }); // Issue related schemas @@ -225,7 +229,7 @@ export const GitHubLabelSchema = z.object({ name: z.string(), color: z.string(), default: z.boolean(), - description: z.string().optional() + description: z.string().optional(), }); export const GitHubIssueAssigneeSchema = z.object({ @@ -233,7 +237,7 @@ export const GitHubIssueAssigneeSchema = z.object({ id: z.number(), avatar_url: z.string(), url: z.string(), - html_url: z.string() + html_url: z.string(), }); export const GitHubMilestoneSchema = z.object({ @@ -245,7 +249,7 @@ export const GitHubMilestoneSchema = z.object({ number: z.number(), title: z.string(), description: z.string(), - state: z.string() + state: z.string(), }); export const GitHubIssueSchema = z.object({ @@ -270,7 +274,7 @@ export const GitHubIssueSchema = z.object({ created_at: z.string(), updated_at: z.string(), closed_at: z.string().nullable(), - body: z.string() + body: z.string(), }); // Pull Request related schemas @@ -279,7 +283,7 @@ export const GitHubPullRequestHeadSchema = z.object({ ref: z.string(), sha: z.string(), user: GitHubIssueAssigneeSchema, - repo: GitHubRepositorySchema + repo: GitHubRepositorySchema, }); export const GitHubPullRequestSchema = z.object({ @@ -304,12 +308,12 @@ export const GitHubPullRequestSchema = z.object({ assignee: GitHubIssueAssigneeSchema.nullable(), assignees: z.array(GitHubIssueAssigneeSchema), head: GitHubPullRequestHeadSchema, - base: GitHubPullRequestHeadSchema + base: GitHubPullRequestHeadSchema, }); const RepoParamsSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), - repo: z.string().describe("Repository name") + repo: z.string().describe("Repository name"), }); export const CreateOrUpdateFileSchema = RepoParamsSchema.extend({ @@ -317,14 +321,24 @@ export const CreateOrUpdateFileSchema = RepoParamsSchema.extend({ content: z.string().describe("Content of the file"), message: z.string().describe("Commit message"), branch: z.string().describe("Branch to create/update the file in"), - sha: z.string().optional() - .describe("SHA of the file being replaced (required when updating existing files)") + sha: z + .string() + .optional() + .describe( + "SHA of the file being replaced (required when updating existing files)" + ), }); export const SearchRepositoriesSchema = z.object({ query: z.string().describe("Search query (see GitHub search syntax)"), - page: z.number().optional().describe("Page number for pagination (default: 1)"), - perPage: z.number().optional().describe("Number of results per page (default: 30, max: 100)") + page: z + .number() + .optional() + .describe("Page number for pagination (default: 1)"), + perPage: z + .number() + .optional() + .describe("Number of results per page (default: 30, max: 100)"), }); export const ListCommitsSchema = z.object({ @@ -339,69 +353,361 @@ export const ListCommitsSchema = z.object({ export const CreateRepositorySchema = z.object({ name: z.string().describe("Repository name"), description: z.string().optional().describe("Repository description"), - private: z.boolean().optional().describe("Whether the repository should be private"), - autoInit: z.boolean().optional().describe("Initialize with README.md") + private: z + .boolean() + .optional() + .describe("Whether the repository should be private"), + autoInit: z.boolean().optional().describe("Initialize with README.md"), }); export const GetFileContentsSchema = RepoParamsSchema.extend({ path: z.string().describe("Path to the file or directory"), - branch: z.string().optional().describe("Branch to get contents from") + branch: z.string().optional().describe("Branch to get contents from"), }); export const PushFilesSchema = RepoParamsSchema.extend({ branch: z.string().describe("Branch to push to (e.g., 'main' or 'master')"), - files: z.array(z.object({ - path: z.string().describe("Path where to create the file"), - content: z.string().describe("Content of the file") - })).describe("Array of files to push"), - message: z.string().describe("Commit message") + files: z + .array( + z.object({ + path: z.string().describe("Path where to create the file"), + content: z.string().describe("Content of the file"), + }) + ) + .describe("Array of files to push"), + message: z.string().describe("Commit message"), }); export const CreateIssueSchema = RepoParamsSchema.extend({ title: z.string().describe("Issue title"), body: z.string().optional().describe("Issue body/description"), - assignees: z.array(z.string()).optional().describe("Array of usernames to assign"), + assignees: z + .array(z.string()) + .optional() + .describe("Array of usernames to assign"), labels: z.array(z.string()).optional().describe("Array of label names"), - milestone: z.number().optional().describe("Milestone number to assign") + milestone: z.number().optional().describe("Milestone number to assign"), }); export const CreatePullRequestSchema = RepoParamsSchema.extend({ title: z.string().describe("Pull request title"), body: z.string().optional().describe("Pull request body/description"), - head: z.string().describe("The name of the branch where your changes are implemented"), - base: z.string().describe("The name of the branch you want the changes pulled into"), - draft: z.boolean().optional().describe("Whether to create the pull request as a draft"), - maintainer_can_modify: z.boolean().optional() - .describe("Whether maintainers can modify the pull request") + head: z + .string() + .describe("The name of the branch where your changes are implemented"), + base: z + .string() + .describe("The name of the branch you want the changes pulled into"), + draft: z + .boolean() + .optional() + .describe("Whether to create the pull request as a draft"), + maintainer_can_modify: z + .boolean() + .optional() + .describe("Whether maintainers can modify the pull request"), }); export const ForkRepositorySchema = RepoParamsSchema.extend({ - organization: z.string().optional() - .describe("Optional: organization to fork to (defaults to your personal account)") + organization: z + .string() + .optional() + .describe( + "Optional: organization to fork to (defaults to your personal account)" + ), }); export const CreateBranchSchema = RepoParamsSchema.extend({ branch: z.string().describe("Name for the new branch"), - from_branch: z.string().optional() - .describe("Optional: source branch to create from (defaults to the repository's default branch)") + from_branch: z + .string() + .optional() + .describe( + "Optional: source branch to create from (defaults to the repository's default branch)" + ), +}); + +/** + * Response schema for a code search result item + * @see https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-code + */ +export const SearchCodeItemSchema = z.object({ + name: z.string().describe("The name of the file"), + path: z.string().describe("The path to the file in the repository"), + sha: z.string().describe("The SHA hash of the file"), + url: z.string().describe("The API URL for this file"), + git_url: z.string().describe("The Git URL for this file"), + html_url: z.string().describe("The HTML URL to view this file on GitHub"), + repository: GitHubRepositorySchema.describe( + "The repository where this file was found" + ), + score: z.number().describe("The search result score"), +}); + +/** + * Response schema for code search results + */ +export const SearchCodeResponseSchema = z.object({ + total_count: z.number().describe("Total number of matching results"), + incomplete_results: z + .boolean() + .describe("Whether the results are incomplete"), + items: z.array(SearchCodeItemSchema).describe("The search results"), +}); + +/** + * Response schema for an issue search result item + * @see https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-issues-and-pull-requests + */ +export const SearchIssueItemSchema = z.object({ + url: z.string().describe("The API URL for this issue"), + repository_url: z + .string() + .describe("The API URL for the repository where this issue was found"), + labels_url: z.string().describe("The API URL for the labels of this issue"), + comments_url: z.string().describe("The API URL for comments of this issue"), + events_url: z.string().describe("The API URL for events of this issue"), + html_url: z.string().describe("The HTML URL to view this issue on GitHub"), + id: z.number().describe("The ID of this issue"), + node_id: z.string().describe("The Node ID of this issue"), + number: z.number().describe("The number of this issue"), + title: z.string().describe("The title of this issue"), + user: GitHubIssueAssigneeSchema.describe("The user who created this issue"), + labels: z.array(GitHubLabelSchema).describe("The labels of this issue"), + state: z.string().describe("The state of this issue"), + locked: z.boolean().describe("Whether this issue is locked"), + assignee: GitHubIssueAssigneeSchema.nullable().describe( + "The assignee of this issue" + ), + assignees: z + .array(GitHubIssueAssigneeSchema) + .describe("The assignees of this issue"), + comments: z.number().describe("The number of comments on this issue"), + created_at: z.string().describe("The creation time of this issue"), + updated_at: z.string().describe("The last update time of this issue"), + closed_at: z.string().nullable().describe("The closure time of this issue"), + body: z.string().describe("The body of this issue"), + score: z.number().describe("The search result score"), + pull_request: z + .object({ + url: z.string().describe("The API URL for this pull request"), + html_url: z.string().describe("The HTML URL to view this pull request"), + diff_url: z.string().describe("The URL to view the diff"), + patch_url: z.string().describe("The URL to view the patch"), + }) + .optional() + .describe("Pull request details if this is a PR"), +}); + +/** + * Response schema for issue search results + */ +export const SearchIssuesResponseSchema = z.object({ + total_count: z.number().describe("Total number of matching results"), + incomplete_results: z + .boolean() + .describe("Whether the results are incomplete"), + items: z.array(SearchIssueItemSchema).describe("The search results"), +}); + +/** + * Response schema for a user search result item + * @see https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-users + */ +export const SearchUserItemSchema = z.object({ + login: z.string().describe("The username of the user"), + id: z.number().describe("The ID of the user"), + node_id: z.string().describe("The Node ID of the user"), + avatar_url: z.string().describe("The avatar URL of the user"), + gravatar_id: z.string().describe("The Gravatar ID of the user"), + url: z.string().describe("The API URL for this user"), + html_url: z.string().describe("The HTML URL to view this user on GitHub"), + followers_url: z.string().describe("The API URL for followers of this user"), + following_url: z.string().describe("The API URL for following of this user"), + gists_url: z.string().describe("The API URL for gists of this user"), + starred_url: z + .string() + .describe("The API URL for starred repositories of this user"), + subscriptions_url: z + .string() + .describe("The API URL for subscriptions of this user"), + organizations_url: z + .string() + .describe("The API URL for organizations of this user"), + repos_url: z.string().describe("The API URL for repositories of this user"), + events_url: z.string().describe("The API URL for events of this user"), + received_events_url: z + .string() + .describe("The API URL for received events of this user"), + type: z.string().describe("The type of this user"), + site_admin: z.boolean().describe("Whether this user is a site administrator"), + score: z.number().describe("The search result score"), +}); + +/** + * Response schema for user search results + */ +export const SearchUsersResponseSchema = z.object({ + total_count: z.number().describe("Total number of matching results"), + incomplete_results: z + .boolean() + .describe("Whether the results are incomplete"), + items: z.array(SearchUserItemSchema).describe("The search results"), +}); + +/** + * Input schema for code search + * @see https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-code--parameters + */ +export const SearchCodeSchema = z.object({ + q: z + .string() + .describe( + "Search query. See GitHub code search syntax: https://docs.github.com/en/search-github/searching-on-github/searching-code" + ), + order: z + .enum(["asc", "desc"]) + .optional() + .describe("Sort order (asc or desc)"), + per_page: z + .number() + .min(1) + .max(100) + .optional() + .describe("Results per page (max 100)"), + page: z.number().min(1).optional().describe("Page number"), +}); + +/** + * Input schema for issues search + * @see https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-issues-and-pull-requests--parameters + */ +export const SearchIssuesSchema = z.object({ + q: z + .string() + .describe( + "Search query. See GitHub issues search syntax: https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests" + ), + sort: z + .enum([ + "comments", + "reactions", + "reactions-+1", + "reactions--1", + "reactions-smile", + "reactions-thinking_face", + "reactions-heart", + "reactions-tada", + "interactions", + "created", + "updated", + ]) + .optional() + .describe("Sort field"), + order: z + .enum(["asc", "desc"]) + .optional() + .describe("Sort order (asc or desc)"), + per_page: z + .number() + .min(1) + .max(100) + .optional() + .describe("Results per page (max 100)"), + page: z.number().min(1).optional().describe("Page number"), +}); + +/** + * Input schema for users search + * @see https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-users--parameters + */ +export const SearchUsersSchema = z.object({ + q: z + .string() + .describe( + "Search query. See GitHub users search syntax: https://docs.github.com/en/search-github/searching-on-github/searching-users" + ), + sort: z + .enum(["followers", "repositories", "joined"]) + .optional() + .describe("Sort field"), + order: z + .enum(["asc", "desc"]) + .optional() + .describe("Sort order (asc or desc)"), + per_page: z + .number() + .min(1) + .max(100) + .optional() + .describe("Results per page (max 100)"), + page: z.number().min(1).optional().describe("Page number"), +}); + +// Add these schema definitions for issue management + +export const ListIssuesOptionsSchema = z.object({ + owner: z.string(), + repo: z.string(), + state: z.enum(['open', 'closed', 'all']).optional(), + labels: z.array(z.string()).optional(), + sort: z.enum(['created', 'updated', 'comments']).optional(), + direction: z.enum(['asc', 'desc']).optional(), + since: z.string().optional(), // ISO 8601 timestamp + page: z.number().optional(), + per_page: z.number().optional() +}); + +export const UpdateIssueOptionsSchema = z.object({ + owner: z.string(), + repo: z.string(), + issue_number: z.number(), + title: z.string().optional(), + body: z.string().optional(), + state: z.enum(['open', 'closed']).optional(), + labels: z.array(z.string()).optional(), + assignees: z.array(z.string()).optional(), + milestone: z.number().optional() +}); + +export const IssueCommentSchema = z.object({ + owner: z.string(), + repo: z.string(), + issue_number: z.number(), + body: z.string() }); // Export types export type GitHubAuthor = z.infer; export type GitHubFork = z.infer; export type GitHubIssue = z.infer; -export type GitHubPullRequest = z.infer;export type GitHubRepository = z.infer; +export type GitHubPullRequest = z.infer; +export type GitHubRepository = z.infer; export type GitHubFileContent = z.infer; -export type GitHubDirectoryContent = z.infer; +export type GitHubDirectoryContent = z.infer< + typeof GitHubDirectoryContentSchema +>; export type GitHubContent = z.infer; export type FileOperation = z.infer; export type GitHubTree = z.infer; export type GitHubCommit = z.infer; export type GitHubListCommits = z.infer; export type GitHubReference = z.infer; -export type CreateRepositoryOptions = z.infer; +export type CreateRepositoryOptions = z.infer< + typeof CreateRepositoryOptionsSchema +>; export type CreateIssueOptions = z.infer; -export type CreatePullRequestOptions = z.infer; +export type CreatePullRequestOptions = z.infer< + typeof CreatePullRequestOptionsSchema +>; export type CreateBranchOptions = z.infer; -export type GitHubCreateUpdateFileResponse = z.infer; -export type GitHubSearchResponse = z.infer; \ No newline at end of file +export type GitHubCreateUpdateFileResponse = z.infer< + typeof GitHubCreateUpdateFileResponseSchema +>; +export type GitHubSearchResponse = z.infer; +export type SearchCodeItem = z.infer; +export type SearchCodeResponse = z.infer; +export type SearchIssueItem = z.infer; +export type SearchIssuesResponse = z.infer; +export type SearchUserItem = z.infer; +export type SearchUsersResponse = z.infer; diff --git a/src/gitlab/package.json b/src/gitlab/package.json index dc8705b7..1259e241 100644 --- a/src/gitlab/package.json +++ b/src/gitlab/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-gitlab", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for using the GitLab API", "license": "MIT", "author": "GitLab, PBC (https://gitlab.com)", @@ -28,4 +28,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/google-maps/package.json b/src/google-maps/package.json index 96d6b207..5e4c04c4 100644 --- a/src/google-maps/package.json +++ b/src/google-maps/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-google-maps", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for using the Google Maps API", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -27,4 +27,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/memory/package.json b/src/memory/package.json index c0eb5450..49cbc92e 100644 --- a/src/memory/package.json +++ b/src/memory/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-memory", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for enabling memory for Claude through a knowledge graph", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -26,4 +26,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/postgres/package.json b/src/postgres/package.json index a80c50b1..70fa0dbd 100644 --- a/src/postgres/package.json +++ b/src/postgres/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-postgres", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for interacting with PostgreSQL databases", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -27,4 +27,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/puppeteer/index.ts b/src/puppeteer/index.ts index d8da6cae..5cae2eb0 100644 --- a/src/puppeteer/index.ts +++ b/src/puppeteer/index.ts @@ -124,6 +124,15 @@ async function ensureBrowser() { return page!; } +declare global { + interface Window { + mcpHelper: { + logs: string[], + originalConsole: Partial, + } + } +} + async function handleToolCall(name: string, args: any): Promise { const page = await ensureBrowser(); @@ -263,32 +272,34 @@ async function handleToolCall(name: string, args: any): Promise case "puppeteer_evaluate": try { - const result = await page.evaluate((script) => { - const logs: string[] = []; - const originalConsole = { ...console }; + await page.evaluate(() => { + window.mcpHelper = { + logs: [], + originalConsole: { ...console }, + }; ['log', 'info', 'warn', 'error'].forEach(method => { (console as any)[method] = (...args: any[]) => { - logs.push(`[${method}] ${args.join(' ')}`); - (originalConsole as any)[method](...args); + window.mcpHelper.logs.push(`[${method}] ${args.join(' ')}`); + (window.mcpHelper.originalConsole as any)[method](...args); }; - }); + } ); + } ); - try { - const result = eval(script); - Object.assign(console, originalConsole); - return { result, logs }; - } catch (error) { - Object.assign(console, originalConsole); - throw error; - } - }, args.script); + const result = await page.evaluate( args.script ); + + const logs = await page.evaluate(() => { + Object.assign(console, window.mcpHelper.originalConsole); + const logs = window.mcpHelper.logs; + delete ( window as any).mcpHelper; + return logs; + }); return { content: [ { type: "text", - text: `Execution result:\n${JSON.stringify(result.result, null, 2)}\n\nConsole output:\n${result.logs.join('\n')}`, + text: `Execution result:\n${JSON.stringify(result, null, 2)}\n\nConsole output:\n${logs.join('\n')}`, }, ], isError: false, @@ -387,4 +398,4 @@ async function runServer() { await server.connect(transport); } -runServer().catch(console.error); \ No newline at end of file +runServer().catch(console.error); diff --git a/src/puppeteer/package.json b/src/puppeteer/package.json index 49e81f0f..6ca49157 100644 --- a/src/puppeteer/package.json +++ b/src/puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-puppeteer", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for browser automation using Puppeteer", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -26,4 +26,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/sentry/pyproject.toml b/src/sentry/pyproject.toml index 7fd27787..0788ad80 100644 --- a/src/sentry/pyproject.toml +++ b/src/sentry/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcp-server-sentry" -version = "0.6.1" +version = "0.6.2" description = "MCP server for retrieving issues from sentry.io" readme = "README.md" requires-python = ">=3.10" diff --git a/src/sentry/uv.lock b/src/sentry/uv.lock index 02c4a900..a9a8c1a6 100644 --- a/src/sentry/uv.lock +++ b/src/sentry/uv.lock @@ -147,7 +147,7 @@ wheels = [ [[package]] name = "mcp-server-sentry" -version = "0.6.0" +version = "0.6.2" source = { editable = "." } dependencies = [ { name = "mcp" }, diff --git a/src/sequentialthinking/package.json b/src/sequentialthinking/package.json index 475d3a5e..d696695e 100644 --- a/src/sequentialthinking/package.json +++ b/src/sequentialthinking/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-sequential-thinking", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for sequential thinking and problem solving", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -29,4 +29,4 @@ "shx": "^0.3.4", "typescript": "^5.3.3" } -} +} \ No newline at end of file diff --git a/src/slack/package.json b/src/slack/package.json index 1fc30420..10e18594 100644 --- a/src/slack/package.json +++ b/src/slack/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-slack", - "version": "0.6.1", + "version": "0.6.2", "description": "MCP server for interacting with Slack", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", @@ -26,4 +26,4 @@ "shx": "^0.3.4", "typescript": "^5.6.2" } -} +} \ No newline at end of file diff --git a/src/sqlite/pyproject.toml b/src/sqlite/pyproject.toml index f09a6f0d..241ad0e2 100644 --- a/src/sqlite/pyproject.toml +++ b/src/sqlite/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcp-server-sqlite" -version = "0.6.1" +version = "0.6.2" description = "A simple SQLite MCP server" readme = "README.md" requires-python = ">=3.10" diff --git a/src/sqlite/uv.lock b/src/sqlite/uv.lock index a9673f7a..87ccbfbd 100644 --- a/src/sqlite/uv.lock +++ b/src/sqlite/uv.lock @@ -138,7 +138,7 @@ wheels = [ [[package]] name = "mcp-server-sqlite" -version = "0.6.0" +version = "0.6.2" source = { editable = "." } dependencies = [ { name = "mcp" }, diff --git a/src/time/pyproject.toml b/src/time/pyproject.toml index 50b2e009..70924951 100644 --- a/src/time/pyproject.toml +++ b/src/time/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcp-server-time" -version = "0.6.1" +version = "0.6.2" description = "A Model Context Protocol server providing tools for time queries and timezone conversions for LLMs" readme = "README.md" requires-python = ">=3.10" diff --git a/src/time/uv.lock b/src/time/uv.lock index 09641798..a8d820ab 100644 --- a/src/time/uv.lock +++ b/src/time/uv.lock @@ -159,7 +159,7 @@ wheels = [ [[package]] name = "mcp-server-time" -version = "0.6.0" +version = "0.6.2" source = { editable = "." } dependencies = [ { name = "mcp" },