@softtechai/quickmcp 1.0.16 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-utils.d.ts +130 -0
- package/dist/auth/auth-utils.d.ts.map +1 -0
- package/dist/auth/auth-utils.js +600 -0
- package/dist/auth/auth-utils.js.map +1 -0
- package/dist/auth/jwks-provider.d.ts +9 -0
- package/dist/auth/jwks-provider.d.ts.map +1 -0
- package/dist/auth/jwks-provider.js +56 -0
- package/dist/auth/jwks-provider.js.map +1 -0
- package/dist/auth/token-utils.d.ts +40 -0
- package/dist/auth/token-utils.d.ts.map +1 -0
- package/dist/auth/token-utils.js +162 -0
- package/dist/auth/token-utils.js.map +1 -0
- package/dist/client/MCPClient.js +5 -4
- package/dist/client/MCPClient.js.map +1 -1
- package/dist/config/auth-config.d.ts +16 -0
- package/dist/config/auth-config.d.ts.map +1 -0
- package/dist/config/auth-config.js +107 -0
- package/dist/config/auth-config.js.map +1 -0
- package/dist/constant/constant.d.ts +20 -0
- package/dist/constant/constant.d.ts.map +1 -0
- package/dist/constant/constant.js +24 -0
- package/dist/constant/constant.js.map +1 -0
- package/dist/database/async-datastore.d.ts +6 -0
- package/dist/database/async-datastore.d.ts.map +1 -0
- package/dist/database/async-datastore.js +15 -0
- package/dist/database/async-datastore.js.map +1 -0
- package/dist/database/database-utils.d.ts +6 -0
- package/dist/database/database-utils.d.ts.map +1 -0
- package/dist/database/database-utils.js +29 -0
- package/dist/database/database-utils.js.map +1 -0
- package/dist/database/datastore.d.ts +164 -0
- package/dist/database/datastore.d.ts.map +1 -0
- package/dist/{parsers/types/index.js → database/datastore.js} +1 -0
- package/dist/database/datastore.js.map +1 -0
- package/dist/database/factory.d.ts +4 -0
- package/dist/database/factory.d.ts.map +1 -0
- package/dist/database/factory.js +32 -0
- package/dist/database/factory.js.map +1 -0
- package/dist/database/jdbc-manager.d.ts +49 -0
- package/dist/database/jdbc-manager.d.ts.map +1 -0
- package/dist/database/jdbc-manager.js +50 -0
- package/dist/database/jdbc-manager.js.map +1 -0
- package/dist/database/sqlite-manager.d.ts +46 -44
- package/dist/database/sqlite-manager.d.ts.map +1 -1
- package/dist/database/sqlite-manager.js +492 -42
- package/dist/database/sqlite-manager.js.map +1 -1
- package/dist/database/supabase-manager.d.ts +58 -0
- package/dist/database/supabase-manager.d.ts.map +1 -0
- package/dist/database/supabase-manager.js +432 -0
- package/dist/database/supabase-manager.js.map +1 -0
- package/dist/generators/MCPServerGenerator.d.ts +103 -20
- package/dist/generators/MCPServerGenerator.d.ts.map +1 -1
- package/dist/generators/MCPServerGenerator.js +6930 -128
- package/dist/generators/MCPServerGenerator.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/integrated-mcp-server-new.d.ts +14 -2
- package/dist/integrated-mcp-server-new.d.ts.map +1 -1
- package/dist/integrated-mcp-server-new.js +270 -180
- package/dist/integrated-mcp-server-new.js.map +1 -1
- package/dist/mcp-core/McpCoreService.d.ts +63 -0
- package/dist/mcp-core/McpCoreService.d.ts.map +1 -0
- package/dist/mcp-core/McpCoreService.js +492 -0
- package/dist/mcp-core/McpCoreService.js.map +1 -0
- package/dist/parsers/CsvParser.d.ts +1 -1
- package/dist/parsers/CsvParser.d.ts.map +1 -1
- package/dist/parsers/CsvParser.js +3 -2
- package/dist/parsers/CsvParser.js.map +1 -1
- package/dist/parsers/DatabaseParser.d.ts.map +1 -1
- package/dist/parsers/DatabaseParser.js +9 -8
- package/dist/parsers/DatabaseParser.js.map +1 -1
- package/dist/parsers/ExcelParser.d.ts +15 -0
- package/dist/parsers/ExcelParser.d.ts.map +1 -1
- package/dist/parsers/ExcelParser.js +287 -21
- package/dist/parsers/ExcelParser.js.map +1 -1
- package/dist/parsers/WebPageParser.d.ts +5 -0
- package/dist/parsers/WebPageParser.d.ts.map +1 -0
- package/dist/parsers/WebPageParser.js +35 -0
- package/dist/parsers/WebPageParser.js.map +1 -0
- package/dist/parsers/index.d.ts +3 -2
- package/dist/parsers/index.d.ts.map +1 -1
- package/dist/parsers/index.js +19 -16
- package/dist/parsers/index.js.map +1 -1
- package/dist/server/api/askApi.d.ts +41 -0
- package/dist/server/api/askApi.d.ts.map +1 -0
- package/dist/server/api/askApi.js +479 -0
- package/dist/server/api/askApi.js.map +1 -0
- package/dist/server/api/authApi.d.ts +101 -0
- package/dist/server/api/authApi.d.ts.map +1 -0
- package/dist/server/api/authApi.js +1472 -0
- package/dist/server/api/authApi.js.map +1 -0
- package/dist/server/api/authProperty.d.ts +18 -0
- package/dist/server/api/authProperty.d.ts.map +1 -0
- package/dist/server/api/authProperty.js +41 -0
- package/dist/server/api/authProperty.js.map +1 -0
- package/dist/server/api/configApi.d.ts +15 -0
- package/dist/server/api/configApi.d.ts.map +1 -0
- package/dist/server/api/configApi.js +42 -0
- package/dist/server/api/configApi.js.map +1 -0
- package/dist/server/api/databaseApi.d.ts +14 -0
- package/dist/server/api/databaseApi.d.ts.map +1 -0
- package/dist/server/api/databaseApi.js +111 -0
- package/dist/server/api/databaseApi.js.map +1 -0
- package/dist/server/api/directoryApi.d.ts +9 -0
- package/dist/server/api/directoryApi.d.ts.map +1 -0
- package/dist/server/api/directoryApi.js +103 -0
- package/dist/server/api/directoryApi.js.map +1 -0
- package/dist/server/api/generateApi.d.ts +24 -0
- package/dist/server/api/generateApi.d.ts.map +1 -0
- package/dist/server/api/generateApi.js +457 -0
- package/dist/server/api/generateApi.js.map +1 -0
- package/dist/server/api/healthApi.d.ts +9 -0
- package/dist/server/api/healthApi.d.ts.map +1 -0
- package/dist/server/api/healthApi.js +15 -0
- package/dist/server/api/healthApi.js.map +1 -0
- package/dist/server/api/indexApi.d.ts +21 -0
- package/dist/server/api/indexApi.d.ts.map +1 -0
- package/dist/server/api/indexApi.js +61 -0
- package/dist/server/api/indexApi.js.map +1 -0
- package/dist/server/api/logsApi.d.ts +12 -0
- package/dist/server/api/logsApi.d.ts.map +1 -0
- package/dist/server/api/logsApi.js +37 -0
- package/dist/server/api/logsApi.js.map +1 -0
- package/dist/server/api/mcpApi.d.ts +20 -0
- package/dist/server/api/mcpApi.d.ts.map +1 -0
- package/dist/server/api/mcpApi.js +120 -0
- package/dist/server/api/mcpApi.js.map +1 -0
- package/dist/server/api/nameApi.d.ts +21 -0
- package/dist/server/api/nameApi.d.ts.map +1 -0
- package/dist/server/api/nameApi.js +42 -0
- package/dist/server/api/nameApi.js.map +1 -0
- package/dist/server/api/parseApi.d.ts +9 -0
- package/dist/server/api/parseApi.d.ts.map +1 -0
- package/dist/server/api/parseApi.js +3245 -0
- package/dist/server/api/parseApi.js.map +1 -0
- package/dist/server/api/serverApi.d.ts +44 -0
- package/dist/server/api/serverApi.d.ts.map +1 -0
- package/dist/server/api/serverApi.js +417 -0
- package/dist/server/api/serverApi.js.map +1 -0
- package/dist/{dynamic-mcp-executor.d.ts → server/dynamic-mcp-executor.d.ts} +4 -5
- package/dist/server/dynamic-mcp-executor.d.ts.map +1 -0
- package/dist/server/dynamic-mcp-executor.js +62 -0
- package/dist/server/dynamic-mcp-executor.js.map +1 -0
- package/dist/server/port-utils.d.ts +14 -0
- package/dist/server/port-utils.d.ts.map +1 -0
- package/dist/server/port-utils.js +31 -0
- package/dist/server/port-utils.js.map +1 -0
- package/dist/server/server-utils.d.ts +13 -0
- package/dist/server/server-utils.d.ts.map +1 -0
- package/dist/server/server-utils.js +72 -0
- package/dist/server/server-utils.js.map +1 -0
- package/dist/{web → server}/server.d.ts +1 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +535 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/tool-executer.d.ts +101 -0
- package/dist/server/tool-executer.d.ts.map +1 -0
- package/dist/server/tool-executer.js +6198 -0
- package/dist/server/tool-executer.js.map +1 -0
- package/dist/types/index.d.ts +1197 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1028 -0
- package/dist/types/index.js.map +1 -1
- package/dist/upload/upload-utils.d.ts +4 -0
- package/dist/upload/upload-utils.d.ts.map +1 -0
- package/dist/upload/upload-utils.js +29 -0
- package/dist/upload/upload-utils.js.map +1 -0
- package/dist/utils/deployment-util.d.ts +14 -0
- package/dist/utils/deployment-util.d.ts.map +1 -0
- package/dist/utils/deployment-util.js +46 -0
- package/dist/utils/deployment-util.js.map +1 -0
- package/dist/utils/logger.d.ts +15 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +18 -6
- package/quickmcp-direct-stdio.js +176 -187
- package/src/web/public/app.js +15370 -1471
- package/src/web/public/authorization.html +868 -0
- package/src/web/public/database-tables.html +283 -547
- package/src/web/public/how-to-use.html +446 -462
- package/src/web/public/how-to-use.js +4 -4
- package/src/web/public/images/app/activepieces.png +0 -0
- package/src/web/public/images/app/airtable.png +0 -0
- package/src/web/public/images/app/androidstudio.png +0 -0
- package/src/web/public/images/app/antigravity.png +0 -0
- package/src/web/public/images/app/applenotes.png +0 -0
- package/src/web/public/images/app/applereminders.png +0 -0
- package/src/web/public/images/app/asana.png +0 -0
- package/src/web/public/images/app/azureai.png +0 -0
- package/src/web/public/images/app/bash.png +0 -0
- package/src/web/public/images/app/bearnotes.png +0 -0
- package/src/web/public/images/app/bitbucket.png +0 -0
- package/src/web/public/images/app/claude.png +0 -0
- package/src/web/public/images/app/cli.png +0 -0
- package/src/web/public/images/app/clickup.png +0 -0
- package/src/web/public/images/app/cohere.png +0 -0
- package/src/web/public/images/app/confluence.png +0 -0
- package/src/web/public/images/app/confluence2.png +0 -0
- package/src/web/public/images/app/curl.png +0 -0
- package/src/web/public/images/app/curl_mini.png +0 -0
- package/src/web/public/images/app/cursor.png +0 -0
- package/src/web/public/images/app/db2.png +0 -0
- package/src/web/public/images/app/deepseek.png +0 -0
- package/src/web/public/images/app/discord.png +0 -0
- package/src/web/public/images/app/docker.png +0 -0
- package/src/web/public/images/app/dockerhub.png +0 -0
- package/src/web/public/images/app/dropbox.png +0 -0
- package/src/web/public/images/app/elasticsearch.png +0 -0
- package/src/web/public/images/app/facebook.png +0 -0
- package/src/web/public/images/app/falai.png +0 -0
- package/src/web/public/images/app/fireworks.png +0 -0
- package/src/web/public/images/app/gdrive.png +0 -0
- package/src/web/public/images/app/gemini.png +0 -0
- package/src/web/public/images/app/github.png +0 -0
- package/src/web/public/images/app/githubcopilot.png +0 -0
- package/src/web/public/images/app/gitlab.png +0 -0
- package/src/web/public/images/app/gmail.png +0 -0
- package/src/web/public/images/app/googlecalender.png +0 -0
- package/src/web/public/images/app/googledocs.png +0 -0
- package/src/web/public/images/app/googlesheets.png +0 -0
- package/src/web/public/images/app/gradle.png +0 -0
- package/src/web/public/images/app/grafana.png +0 -0
- package/src/web/public/images/app/graphql.png +0 -0
- package/src/web/public/images/app/grok.png +0 -0
- package/src/web/public/images/app/groq.png +0 -0
- package/src/web/public/images/app/hazelcast.png +0 -0
- package/src/web/public/images/app/huggingface.png +0 -0
- package/src/web/public/images/app/imessage.png +0 -0
- package/src/web/public/images/app/instagram.png +0 -0
- package/src/web/public/images/app/intellij.png +0 -0
- package/src/web/public/images/app/jenkins.png +0 -0
- package/src/web/public/images/app/jira.png +0 -0
- package/src/web/public/images/app/kafka.png +0 -0
- package/src/web/public/images/app/kubernetes.png +0 -0
- package/src/web/public/images/app/linear.png +0 -0
- package/src/web/public/images/app/linkedin.png +0 -0
- package/src/web/public/images/app/llama.png +0 -0
- package/src/web/public/images/app/make.png +0 -0
- package/src/web/public/images/app/maven.png +0 -0
- package/src/web/public/images/app/mcp.png +0 -0
- package/src/web/public/images/app/microsoftteams.png +0 -0
- package/src/web/public/images/app/mistral.png +0 -0
- package/src/web/public/images/app/monday.png +0 -0
- package/src/web/public/images/app/mongodb.png +0 -0
- package/src/web/public/images/app/mssql.png +0 -0
- package/src/web/public/images/app/mysql.png +0 -0
- package/src/web/public/images/app/n8n.png +0 -0
- package/src/web/public/images/app/notion.png +0 -0
- package/src/web/public/images/app/npm.png +0 -0
- package/src/web/public/images/app/nuget.png +0 -0
- package/src/web/public/images/app/obsidian.png +0 -0
- package/src/web/public/images/app/openai.png +0 -0
- package/src/web/public/images/app/openrouter.png +0 -0
- package/src/web/public/images/app/opensearch.png +0 -0
- package/src/web/public/images/app/openshift.png +0 -0
- package/src/web/public/images/app/oracle.png +0 -0
- package/src/web/public/images/app/perplexity.png +0 -0
- package/src/web/public/images/app/pipedream.png +0 -0
- package/src/web/public/images/app/postgresql.png +0 -0
- package/src/web/public/images/app/powershell.png +0 -0
- package/src/web/public/images/app/prometheus.png +0 -0
- package/src/web/public/images/app/reddit.png +0 -0
- package/src/web/public/images/app/redis.png +0 -0
- package/src/web/public/images/app/rss.png +0 -0
- package/src/web/public/images/app/signal.png +0 -0
- package/src/web/public/images/app/slack.png +0 -0
- package/src/web/public/images/app/soap.png +0 -0
- package/src/web/public/images/app/sqlite.png +0 -0
- package/src/web/public/images/app/supabase.png +0 -0
- package/src/web/public/images/app/telegram.png +0 -0
- package/src/web/public/images/app/things3.png +0 -0
- package/src/web/public/images/app/threads.png +0 -0
- package/src/web/public/images/app/tiktok.png +0 -0
- package/src/web/public/images/app/together.png +0 -0
- package/src/web/public/images/app/trello.png +0 -0
- package/src/web/public/images/app/vscode.png +0 -0
- package/src/web/public/images/app/webhook.png +0 -0
- package/src/web/public/images/app/webpage.png +0 -0
- package/src/web/public/images/app/whatsappbusiness.png +0 -0
- package/src/web/public/images/app/windsorf.png +0 -0
- package/src/web/public/images/app/x.png +0 -0
- package/src/web/public/images/app/youtube.png +0 -0
- package/src/web/public/images/app/zapier.png +0 -0
- package/src/web/public/images/app/zededitor.png +0 -0
- package/src/web/public/images/app/zoom.png +0 -0
- package/src/web/public/images/avatar-anon.svg +4 -0
- package/src/web/public/images/favicon.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step0.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step1.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step2.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step3.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step4.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step5.png +0 -0
- package/src/web/public/images/readme/1-generate-servers.png +0 -0
- package/src/web/public/images/readme/2-database-connection.png +0 -0
- package/src/web/public/images/readme/2-file-upload.png +0 -0
- package/src/web/public/images/readme/3-data-preview.png +0 -0
- package/src/web/public/images/readme/4-data-preview2.png +0 -0
- package/src/web/public/images/readme/5-server-configuration.png +0 -0
- package/src/web/public/images/readme/6-server-generated-modal.png +0 -0
- package/src/web/public/images/readme/7-generated-servers.png +0 -0
- package/src/web/public/images/readme/8-generated-servers-view-details.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.23.51.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.24.59.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.05.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.14.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.21.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.36.png +0 -0
- package/src/web/public/index.html +4685 -488
- package/src/web/public/landing.html +1638 -0
- package/src/web/public/logger.js +31 -0
- package/src/web/public/login.html +372 -0
- package/src/web/public/manage-servers.html +121 -188
- package/src/web/public/pricing.html +537 -0
- package/src/web/public/quick-ask.html +133 -0
- package/src/web/public/quickmcp-styles.css +708 -0
- package/src/web/public/roles.html +177 -0
- package/src/web/public/shared.js +736 -3
- package/src/web/public/sidebar.js +414 -0
- package/src/web/public/test-servers.html +605 -221
- package/src/web/public/users.html +191 -0
- package/dist/client/MCPClientUnified.d.ts +0 -31
- package/dist/client/MCPClientUnified.d.ts.map +0 -1
- package/dist/client/MCPClientUnified.js +0 -275
- package/dist/client/MCPClientUnified.js.map +0 -1
- package/dist/client/MCPTestRunnerUnified.d.ts +0 -48
- package/dist/client/MCPTestRunnerUnified.d.ts.map +0 -1
- package/dist/client/MCPTestRunnerUnified.js +0 -183
- package/dist/client/MCPTestRunnerUnified.js.map +0 -1
- package/dist/database/json-manager.d.ts +0 -55
- package/dist/database/json-manager.d.ts.map +0 -1
- package/dist/database/json-manager.js +0 -128
- package/dist/database/json-manager.js.map +0 -1
- package/dist/dynamic-mcp-executor.d.ts.map +0 -1
- package/dist/dynamic-mcp-executor.js +0 -274
- package/dist/dynamic-mcp-executor.js.map +0 -1
- package/dist/generators/MCPServerGenerator-new.d.ts +0 -37
- package/dist/generators/MCPServerGenerator-new.d.ts.map +0 -1
- package/dist/generators/MCPServerGenerator-new.js +0 -287
- package/dist/generators/MCPServerGenerator-new.js.map +0 -1
- package/dist/generators/database/sqlite-manager.d.ts +0 -52
- package/dist/generators/database/sqlite-manager.js +0 -143
- package/dist/generators/generators/MCPServerGenerator.d.ts +0 -37
- package/dist/generators/generators/MCPServerGenerator.js +0 -396
- package/dist/integrated-mcp-server.d.ts +0 -25
- package/dist/integrated-mcp-server.d.ts.map +0 -1
- package/dist/integrated-mcp-server.js +0 -541
- package/dist/integrated-mcp-server.js.map +0 -1
- package/dist/mcp-inspector-server.d.ts +0 -3
- package/dist/mcp-inspector-server.d.ts.map +0 -1
- package/dist/mcp-inspector-server.js +0 -119
- package/dist/mcp-inspector-server.js.map +0 -1
- package/dist/mcp-sdk-server.d.ts +0 -3
- package/dist/mcp-sdk-server.d.ts.map +0 -1
- package/dist/mcp-sdk-server.js +0 -90
- package/dist/mcp-sdk-server.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -3
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js +0 -300
- package/dist/mcp-server.js.map +0 -1
- package/dist/parsers/parsers/ExcelParser.js +0 -118
- package/dist/quickmcp-unified-bridge.d.ts +0 -13
- package/dist/quickmcp-unified-bridge.d.ts.map +0 -1
- package/dist/quickmcp-unified-bridge.js +0 -176
- package/dist/quickmcp-unified-bridge.js.map +0 -1
- package/dist/sqlite-manager.js +0 -145
- package/dist/test-app.d.ts +0 -2
- package/dist/test-app.d.ts.map +0 -1
- package/dist/test-app.js +0 -119
- package/dist/test-app.js.map +0 -1
- package/dist/transport/base-transport.d.ts +0 -21
- package/dist/transport/base-transport.d.ts.map +0 -1
- package/dist/transport/base-transport.js +0 -16
- package/dist/transport/base-transport.js.map +0 -1
- package/dist/transport/index.d.ts +0 -10
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js +0 -12
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/sse-transport.d.ts +0 -13
- package/dist/transport/sse-transport.d.ts.map +0 -1
- package/dist/transport/sse-transport.js +0 -106
- package/dist/transport/sse-transport.js.map +0 -1
- package/dist/transport/stdio-transport.d.ts +0 -8
- package/dist/transport/stdio-transport.d.ts.map +0 -1
- package/dist/transport/stdio-transport.js +0 -53
- package/dist/transport/stdio-transport.js.map +0 -1
- package/dist/transport/streamable-http-transport.d.ts +0 -15
- package/dist/transport/streamable-http-transport.d.ts.map +0 -1
- package/dist/transport/streamable-http-transport.js +0 -151
- package/dist/transport/streamable-http-transport.js.map +0 -1
- package/dist/web/client/MCPClient.js +0 -348
- package/dist/web/client/MCPTestRunner.js +0 -317
- package/dist/web/database/json-manager.js +0 -124
- package/dist/web/database/sqlite-manager.js +0 -146
- package/dist/web/dynamic-mcp-executor.js +0 -443
- package/dist/web/generators/MCPServerGenerator-new.js +0 -284
- package/dist/web/generators/MCPServerGenerator.js +0 -566
- package/dist/web/integrated-mcp-server-new.js +0 -394
- package/dist/web/parsers/CsvParser.js +0 -144
- package/dist/web/parsers/DatabaseParser.js +0 -637
- package/dist/web/parsers/ExcelParser.js +0 -180
- package/dist/web/parsers/index.js +0 -152
- package/dist/web/server.d.ts.map +0 -1
- package/dist/web/server.js +0 -790
- package/dist/web/server.js.map +0 -1
- package/dist/web/types/index.js +0 -2
- package/dist/web/web/server.js +0 -860
- package/src/web/public/modern-styles.css +0 -946
- package/src/web/public/shared-styles.css +0 -2091
- /package/src/web/public/images/{1-claude-quickmcp-stdio.png → readme/1-claude-quickmcp-stdio.png} +0 -0
- /package/src/web/public/images/{2-claude-tools.png → readme/2-claude-tools.png} +0 -0
- /package/src/web/public/images/{3-claude-developer-settings.png → readme/3-claude-developer-settings.png} +0 -0
- /package/src/web/public/images/{4-claude-config.png → readme/4-claude-config.png} +0 -0
- /package/src/web/public/images/{5-claude-config-edit.png → readme/5-claude-config-edit.png} +0 -0
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MCPTestRunnerUnified = void 0;
|
|
4
|
-
const MCPClientUnified_1 = require("./MCPClientUnified");
|
|
5
|
-
class MCPTestRunnerUnified {
|
|
6
|
-
constructor(ssePort = 3001) {
|
|
7
|
-
this.stdioClient = new MCPClientUnified_1.MCPClientUnified('stdio');
|
|
8
|
-
this.sseClient = new MCPClientUnified_1.MCPClientUnified('sse', ssePort);
|
|
9
|
-
}
|
|
10
|
-
async runTestSuiteBothTransports(serverPath, testSuite) {
|
|
11
|
-
console.log('Running tests with STDIO transport...');
|
|
12
|
-
const stdioResult = await this.runTestSuite(serverPath, testSuite, 'stdio');
|
|
13
|
-
console.log('Running tests with SSE transport...');
|
|
14
|
-
const sseResult = await this.runTestSuite(null, testSuite, 'sse');
|
|
15
|
-
return { stdio: stdioResult, sse: sseResult };
|
|
16
|
-
}
|
|
17
|
-
async runTestSuite(serverPath, testSuite, transport = 'stdio') {
|
|
18
|
-
const startTime = Date.now();
|
|
19
|
-
const results = [];
|
|
20
|
-
const client = transport === 'stdio' ? this.stdioClient : this.sseClient;
|
|
21
|
-
try {
|
|
22
|
-
if (transport === 'stdio' && !serverPath) {
|
|
23
|
-
throw new Error('Server path required for stdio transport');
|
|
24
|
-
}
|
|
25
|
-
await client.connect(serverPath || undefined);
|
|
26
|
-
for (const testCase of testSuite.tests) {
|
|
27
|
-
const result = await this.runTestCase(client, testCase, transport);
|
|
28
|
-
results.push(result);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error(`Error running test suite with ${transport}:`, error);
|
|
33
|
-
}
|
|
34
|
-
finally {
|
|
35
|
-
await client.disconnect();
|
|
36
|
-
}
|
|
37
|
-
const duration = Date.now() - startTime;
|
|
38
|
-
const passedTests = results.filter(r => r.passed).length;
|
|
39
|
-
const failedTests = results.length - passedTests;
|
|
40
|
-
return {
|
|
41
|
-
testSuite,
|
|
42
|
-
results,
|
|
43
|
-
totalTests: results.length,
|
|
44
|
-
passedTests,
|
|
45
|
-
failedTests,
|
|
46
|
-
duration,
|
|
47
|
-
transport
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
async runTestCase(client, testCase, transport) {
|
|
51
|
-
const startTime = Date.now();
|
|
52
|
-
try {
|
|
53
|
-
const response = await client.testRequest(testCase.request);
|
|
54
|
-
const duration = Date.now() - startTime;
|
|
55
|
-
const passed = this.evaluateTestResult(testCase, response);
|
|
56
|
-
return {
|
|
57
|
-
testCase,
|
|
58
|
-
response,
|
|
59
|
-
passed,
|
|
60
|
-
duration,
|
|
61
|
-
transport
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
const duration = Date.now() - startTime;
|
|
66
|
-
return {
|
|
67
|
-
testCase,
|
|
68
|
-
response: {
|
|
69
|
-
success: false,
|
|
70
|
-
error: error instanceof Error ? error.message : 'Unknown error'
|
|
71
|
-
},
|
|
72
|
-
passed: false,
|
|
73
|
-
duration,
|
|
74
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
75
|
-
transport
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
async generateTestSuite(serverPath, suiteName, transport = 'stdio') {
|
|
80
|
-
const client = transport === 'stdio' ? this.stdioClient : this.sseClient;
|
|
81
|
-
if (transport === 'stdio' && !serverPath) {
|
|
82
|
-
throw new Error('Server path required for stdio transport');
|
|
83
|
-
}
|
|
84
|
-
await client.connect(serverPath || undefined);
|
|
85
|
-
try {
|
|
86
|
-
const tools = await client.listTools();
|
|
87
|
-
const resources = await client.listResources();
|
|
88
|
-
const prompts = await client.listPrompts();
|
|
89
|
-
const tests = [];
|
|
90
|
-
// Generate tool tests
|
|
91
|
-
for (const tool of tools) {
|
|
92
|
-
tests.push({
|
|
93
|
-
name: `Test tool: ${tool.name}`,
|
|
94
|
-
description: `Test the ${tool.name} tool with sample parameters`,
|
|
95
|
-
request: {
|
|
96
|
-
serverId: suiteName,
|
|
97
|
-
method: 'tool',
|
|
98
|
-
name: tool.name,
|
|
99
|
-
params: this.generateSampleParams(tool.inputSchema)
|
|
100
|
-
},
|
|
101
|
-
expectedSuccess: true
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
// Generate resource tests
|
|
105
|
-
for (const resource of resources) {
|
|
106
|
-
tests.push({
|
|
107
|
-
name: `Test resource: ${resource.name}`,
|
|
108
|
-
description: `Test reading the ${resource.name} resource`,
|
|
109
|
-
request: {
|
|
110
|
-
serverId: suiteName,
|
|
111
|
-
method: 'resource',
|
|
112
|
-
name: resource.uri,
|
|
113
|
-
},
|
|
114
|
-
expectedSuccess: true
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
// Generate prompt tests
|
|
118
|
-
for (const prompt of prompts) {
|
|
119
|
-
tests.push({
|
|
120
|
-
name: `Test prompt: ${prompt.name}`,
|
|
121
|
-
description: `Test the ${prompt.name} prompt with sample arguments`,
|
|
122
|
-
request: {
|
|
123
|
-
serverId: suiteName,
|
|
124
|
-
method: 'prompt',
|
|
125
|
-
name: prompt.name,
|
|
126
|
-
params: this.generateSampleParams(prompt.arguments)
|
|
127
|
-
},
|
|
128
|
-
expectedSuccess: true
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
name: suiteName,
|
|
133
|
-
description: `Auto-generated test suite for ${suiteName}`,
|
|
134
|
-
tests
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
finally {
|
|
138
|
-
await client.disconnect();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
evaluateTestResult(testCase, response) {
|
|
142
|
-
if (testCase.expectedSuccess !== undefined) {
|
|
143
|
-
if (testCase.expectedSuccess !== response.success) {
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
if (testCase.expectedDataContains && response.data) {
|
|
148
|
-
const dataStr = JSON.stringify(response.data);
|
|
149
|
-
const expectedStr = JSON.stringify(testCase.expectedDataContains);
|
|
150
|
-
if (!dataStr.includes(expectedStr)) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return response.success;
|
|
155
|
-
}
|
|
156
|
-
generateSampleParams(schema) {
|
|
157
|
-
if (!schema || !schema.properties) {
|
|
158
|
-
return {};
|
|
159
|
-
}
|
|
160
|
-
const params = {};
|
|
161
|
-
for (const [key, propValue] of Object.entries(schema.properties)) {
|
|
162
|
-
const prop = propValue;
|
|
163
|
-
if (prop.type === 'string') {
|
|
164
|
-
params[key] = prop.default || 'test';
|
|
165
|
-
}
|
|
166
|
-
else if (prop.type === 'number') {
|
|
167
|
-
params[key] = prop.default || 1;
|
|
168
|
-
}
|
|
169
|
-
else if (prop.type === 'boolean') {
|
|
170
|
-
params[key] = prop.default || false;
|
|
171
|
-
}
|
|
172
|
-
else if (prop.type === 'array') {
|
|
173
|
-
params[key] = [];
|
|
174
|
-
}
|
|
175
|
-
else if (prop.type === 'object') {
|
|
176
|
-
params[key] = {};
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return params;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
exports.MCPTestRunnerUnified = MCPTestRunnerUnified;
|
|
183
|
-
//# sourceMappingURL=MCPTestRunnerUnified.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file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AAC,OAAO,IAAI,CAAC,CAAC;YAClC,CAAC;iBAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC;YACtC,CAAC;iBAAM,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACjC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;iBAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAClC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxND,oDAwNC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export interface ServerConfig {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
dbConfig: {
|
|
5
|
-
type: 'mssql' | 'mysql' | 'postgresql';
|
|
6
|
-
server: string;
|
|
7
|
-
port: number;
|
|
8
|
-
database: string;
|
|
9
|
-
username: string;
|
|
10
|
-
password: string;
|
|
11
|
-
encrypt?: boolean;
|
|
12
|
-
trustServerCertificate?: boolean;
|
|
13
|
-
};
|
|
14
|
-
createdAt: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ToolDefinition {
|
|
17
|
-
server_id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
description: string;
|
|
20
|
-
inputSchema: any;
|
|
21
|
-
sqlQuery: string;
|
|
22
|
-
operation: 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE';
|
|
23
|
-
}
|
|
24
|
-
export interface ResourceDefinition {
|
|
25
|
-
server_id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
uri_template: string;
|
|
29
|
-
sqlQuery: string;
|
|
30
|
-
}
|
|
31
|
-
export declare class JSONManager {
|
|
32
|
-
private dbPath;
|
|
33
|
-
private data;
|
|
34
|
-
constructor();
|
|
35
|
-
private loadData;
|
|
36
|
-
private initializeEmptyData;
|
|
37
|
-
private saveData;
|
|
38
|
-
saveServer(server: ServerConfig): void;
|
|
39
|
-
getServer(serverId: string): ServerConfig | null;
|
|
40
|
-
getAllServers(): ServerConfig[];
|
|
41
|
-
deleteServer(serverId: string): void;
|
|
42
|
-
saveTools(tools: ToolDefinition[]): void;
|
|
43
|
-
getToolsForServer(serverId: string): ToolDefinition[];
|
|
44
|
-
getAllTools(): ToolDefinition[];
|
|
45
|
-
saveResources(resources: ResourceDefinition[]): void;
|
|
46
|
-
getResourcesForServer(serverId: string): ResourceDefinition[];
|
|
47
|
-
getAllResources(): ResourceDefinition[];
|
|
48
|
-
close(): void;
|
|
49
|
-
getStats(): {
|
|
50
|
-
servers: number;
|
|
51
|
-
tools: number;
|
|
52
|
-
resources: number;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=json-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-manager.d.ts","sourceRoot":"","sources":["../../src/database/json-manager.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,YAAY,CAAC;QACvC,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb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(mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.JSONManager = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
class JSONManager {
|
|
10
|
-
constructor() {
|
|
11
|
-
// Create database directory if it doesn't exist
|
|
12
|
-
const dbDir = path_1.default.join(process.cwd(), 'data');
|
|
13
|
-
if (!fs_1.default.existsSync(dbDir)) {
|
|
14
|
-
fs_1.default.mkdirSync(dbDir, { recursive: true });
|
|
15
|
-
}
|
|
16
|
-
this.dbPath = path_1.default.join(dbDir, 'quickmcp.json');
|
|
17
|
-
this.loadData();
|
|
18
|
-
//console.log('✅ JSON database initialized:', this.dbPath);
|
|
19
|
-
}
|
|
20
|
-
loadData() {
|
|
21
|
-
if (fs_1.default.existsSync(this.dbPath)) {
|
|
22
|
-
try {
|
|
23
|
-
const jsonData = fs_1.default.readFileSync(this.dbPath, 'utf8');
|
|
24
|
-
this.data = JSON.parse(jsonData);
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
console.error('❌ Error loading JSON database:', error);
|
|
28
|
-
this.initializeEmptyData();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.initializeEmptyData();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
initializeEmptyData() {
|
|
36
|
-
this.data = {
|
|
37
|
-
servers: [],
|
|
38
|
-
tools: [],
|
|
39
|
-
resources: []
|
|
40
|
-
};
|
|
41
|
-
this.saveData();
|
|
42
|
-
}
|
|
43
|
-
saveData() {
|
|
44
|
-
try {
|
|
45
|
-
fs_1.default.writeFileSync(this.dbPath, JSON.stringify(this.data, null, 2));
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
console.error('❌ Error saving JSON database:', error);
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// Server operations
|
|
53
|
-
saveServer(server) {
|
|
54
|
-
const existingIndex = this.data.servers.findIndex(s => s.id === server.id);
|
|
55
|
-
if (existingIndex >= 0) {
|
|
56
|
-
this.data.servers[existingIndex] = server;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
this.data.servers.push(server);
|
|
60
|
-
}
|
|
61
|
-
this.saveData();
|
|
62
|
-
}
|
|
63
|
-
getServer(serverId) {
|
|
64
|
-
return this.data.servers.find(s => s.id === serverId) || null;
|
|
65
|
-
}
|
|
66
|
-
getAllServers() {
|
|
67
|
-
return [...this.data.servers].sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
68
|
-
}
|
|
69
|
-
deleteServer(serverId) {
|
|
70
|
-
this.data.servers = this.data.servers.filter(s => s.id !== serverId);
|
|
71
|
-
this.data.tools = this.data.tools.filter(t => t.server_id !== serverId);
|
|
72
|
-
this.data.resources = this.data.resources.filter(r => r.server_id !== serverId);
|
|
73
|
-
this.saveData();
|
|
74
|
-
}
|
|
75
|
-
// Tool operations
|
|
76
|
-
saveTools(tools) {
|
|
77
|
-
for (const tool of tools) {
|
|
78
|
-
const existingIndex = this.data.tools.findIndex(t => t.server_id === tool.server_id && t.name === tool.name);
|
|
79
|
-
if (existingIndex >= 0) {
|
|
80
|
-
this.data.tools[existingIndex] = tool;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.data.tools.push(tool);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
this.saveData();
|
|
87
|
-
}
|
|
88
|
-
getToolsForServer(serverId) {
|
|
89
|
-
return this.data.tools.filter(t => t.server_id === serverId);
|
|
90
|
-
}
|
|
91
|
-
getAllTools() {
|
|
92
|
-
return [...this.data.tools];
|
|
93
|
-
}
|
|
94
|
-
// Resource operations
|
|
95
|
-
saveResources(resources) {
|
|
96
|
-
for (const resource of resources) {
|
|
97
|
-
const existingIndex = this.data.resources.findIndex(r => r.server_id === resource.server_id && r.name === resource.name);
|
|
98
|
-
if (existingIndex >= 0) {
|
|
99
|
-
this.data.resources[existingIndex] = resource;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
this.data.resources.push(resource);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
this.saveData();
|
|
106
|
-
}
|
|
107
|
-
getResourcesForServer(serverId) {
|
|
108
|
-
return this.data.resources.filter(r => r.server_id === serverId);
|
|
109
|
-
}
|
|
110
|
-
getAllResources() {
|
|
111
|
-
return [...this.data.resources];
|
|
112
|
-
}
|
|
113
|
-
// Cleanup
|
|
114
|
-
close() {
|
|
115
|
-
// JSON manager doesn't need cleanup
|
|
116
|
-
//console.log('📁 JSON manager closed');
|
|
117
|
-
}
|
|
118
|
-
// Statistics
|
|
119
|
-
getStats() {
|
|
120
|
-
return {
|
|
121
|
-
servers: this.data.servers.length,
|
|
122
|
-
tools: this.data.tools.length,
|
|
123
|
-
resources: this.data.resources.length
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
exports.JSONManager = JSONManager;
|
|
128
|
-
//# sourceMappingURL=json-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-manager.js","sourceRoot":"","sources":["../../src/database/json-manager.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAyCxB,MAAa,WAAW;IAItB;QACE,gDAAgD;QAChD,MAAM,KAAK,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,YAAE,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,cAAI,CAAC,IAAI,C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O,CAAC,GAAG,CAAC;IA2CtD,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;YA6CxC,qBAAqB;YAwErB,YAAY;IAqF1B,QAAQ,IAAI,GAAG;IAOT,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAwB7B"}
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DynamicMCPExecutor = void 0;
|
|
7
|
-
const sqlite_manager_1 = require("./database/sqlite-manager");
|
|
8
|
-
const mssql_1 = __importDefault(require("mssql"));
|
|
9
|
-
const promise_1 = __importDefault(require("mysql2/promise"));
|
|
10
|
-
const pg_1 = require("pg");
|
|
11
|
-
class DynamicMCPExecutor {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.dbConnections = new Map();
|
|
14
|
-
this.sqliteManager = new sqlite_manager_1.SQLiteManager();
|
|
15
|
-
}
|
|
16
|
-
async getAllTools() {
|
|
17
|
-
const tools = this.sqliteManager.getAllTools();
|
|
18
|
-
return tools.map(tool => ({
|
|
19
|
-
name: `${tool.server_id}__${tool.name}`,
|
|
20
|
-
description: `[${tool.server_id}] ${tool.description}`,
|
|
21
|
-
inputSchema: typeof tool.inputSchema === 'string' ? JSON.parse(tool.inputSchema) : tool.inputSchema
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
async getAllResources() {
|
|
25
|
-
const resources = this.sqliteManager.getAllResources();
|
|
26
|
-
return resources.map(resource => ({
|
|
27
|
-
name: `${resource.server_id}__${resource.name}`,
|
|
28
|
-
description: `[${resource.server_id}] ${resource.description}`,
|
|
29
|
-
uri: resource.uri_template
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
async executeTool(toolName, args) {
|
|
33
|
-
try {
|
|
34
|
-
// Parse tool name: "serverId__toolName"
|
|
35
|
-
const parts = toolName.split('__');
|
|
36
|
-
if (parts.length !== 2) {
|
|
37
|
-
throw new Error(`Invalid tool name format: ${toolName}`);
|
|
38
|
-
}
|
|
39
|
-
const [serverId, actualToolName] = parts;
|
|
40
|
-
// Get tool definition from JSON database
|
|
41
|
-
const tools = this.sqliteManager.getToolsForServer(serverId);
|
|
42
|
-
const tool = tools.find(t => t.name === actualToolName);
|
|
43
|
-
if (!tool) {
|
|
44
|
-
throw new Error(`Tool not found: ${toolName}`);
|
|
45
|
-
}
|
|
46
|
-
// Get server config from JSON database
|
|
47
|
-
const serverConfig = this.sqliteManager.getServer(serverId);
|
|
48
|
-
if (!serverConfig) {
|
|
49
|
-
throw new Error(`Server not found: ${serverId}`);
|
|
50
|
-
}
|
|
51
|
-
// Get or create database connection
|
|
52
|
-
const dbConnection = await this.getOrCreateConnection(serverId, serverConfig.dbConfig);
|
|
53
|
-
// Execute the SQL query
|
|
54
|
-
const result = await this.executeQuery(dbConnection, tool.sqlQuery, args, tool.operation);
|
|
55
|
-
console.error(`✅ Executed tool ${toolName} successfully`);
|
|
56
|
-
return {
|
|
57
|
-
success: true,
|
|
58
|
-
data: result,
|
|
59
|
-
rowCount: Array.isArray(result) ? result.length : (result.rowsAffected || 0)
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.error(`❌ Error executing tool ${toolName}:`, error);
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async readResource(resourceName) {
|
|
68
|
-
try {
|
|
69
|
-
// Parse resource name: "serverId__resourceName"
|
|
70
|
-
const parts = resourceName.split('__');
|
|
71
|
-
if (parts.length !== 2) {
|
|
72
|
-
throw new Error(`Invalid resource name format: ${resourceName}`);
|
|
73
|
-
}
|
|
74
|
-
const [serverId, actualResourceName] = parts;
|
|
75
|
-
// Get resource definition from JSON database
|
|
76
|
-
const resources = this.sqliteManager.getResourcesForServer(serverId);
|
|
77
|
-
const resource = resources.find(r => r.name === actualResourceName);
|
|
78
|
-
if (!resource) {
|
|
79
|
-
throw new Error(`Resource not found: ${resourceName}`);
|
|
80
|
-
}
|
|
81
|
-
// Get server config from JSON database
|
|
82
|
-
const serverConfig = this.sqliteManager.getServer(serverId);
|
|
83
|
-
if (!serverConfig) {
|
|
84
|
-
throw new Error(`Server not found: ${serverId}`);
|
|
85
|
-
}
|
|
86
|
-
// Get or create database connection
|
|
87
|
-
const dbConnection = await this.getOrCreateConnection(serverId, serverConfig.dbConfig);
|
|
88
|
-
// Execute the SQL query
|
|
89
|
-
const result = await this.executeQuery(dbConnection, resource.sqlQuery, {}, 'SELECT');
|
|
90
|
-
console.error(`✅ Read resource ${resourceName} successfully`);
|
|
91
|
-
return {
|
|
92
|
-
contents: [{
|
|
93
|
-
uri: resource.uri_template,
|
|
94
|
-
mimeType: 'application/json',
|
|
95
|
-
text: JSON.stringify(result, null, 2)
|
|
96
|
-
}]
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
console.error(`❌ Error reading resource ${resourceName}:`, error);
|
|
101
|
-
throw error;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
async getOrCreateConnection(serverId, dbConfig) {
|
|
105
|
-
if (this.dbConnections.has(serverId)) {
|
|
106
|
-
return this.dbConnections.get(serverId);
|
|
107
|
-
}
|
|
108
|
-
let connection;
|
|
109
|
-
let dbConnection;
|
|
110
|
-
try {
|
|
111
|
-
switch (dbConfig.type) {
|
|
112
|
-
case 'mssql':
|
|
113
|
-
connection = await mssql_1.default.connect({
|
|
114
|
-
server: dbConfig.host,
|
|
115
|
-
port: dbConfig.port || 1433,
|
|
116
|
-
database: dbConfig.database,
|
|
117
|
-
user: dbConfig.username,
|
|
118
|
-
password: dbConfig.password,
|
|
119
|
-
options: {
|
|
120
|
-
encrypt: dbConfig.encrypt || false,
|
|
121
|
-
trustServerCertificate: dbConfig.trustServerCertificate ?? true
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
console.error(`🔗 Connected to MSSQL database for server ${serverId}`);
|
|
125
|
-
break;
|
|
126
|
-
case 'mysql':
|
|
127
|
-
connection = promise_1.default.createConnection({
|
|
128
|
-
host: dbConfig.host,
|
|
129
|
-
port: dbConfig.port || 3306,
|
|
130
|
-
database: dbConfig.database,
|
|
131
|
-
user: dbConfig.username,
|
|
132
|
-
password: dbConfig.password
|
|
133
|
-
});
|
|
134
|
-
await connection.connect();
|
|
135
|
-
console.error(`🔗 Connected to MySQL database for server ${serverId}`);
|
|
136
|
-
break;
|
|
137
|
-
case 'postgresql':
|
|
138
|
-
connection = new pg_1.Pool({
|
|
139
|
-
host: dbConfig.host,
|
|
140
|
-
port: dbConfig.port || 5432,
|
|
141
|
-
database: dbConfig.database,
|
|
142
|
-
user: dbConfig.username,
|
|
143
|
-
password: dbConfig.password
|
|
144
|
-
});
|
|
145
|
-
// Test connection
|
|
146
|
-
await connection.query('SELECT 1');
|
|
147
|
-
console.error(`🔗 Connected to PostgreSQL database for server ${serverId}`);
|
|
148
|
-
break;
|
|
149
|
-
default:
|
|
150
|
-
throw new Error(`Unsupported database type: ${dbConfig.type}`);
|
|
151
|
-
}
|
|
152
|
-
dbConnection = {
|
|
153
|
-
type: dbConfig.type,
|
|
154
|
-
connection,
|
|
155
|
-
config: dbConfig
|
|
156
|
-
};
|
|
157
|
-
this.dbConnections.set(serverId, dbConnection);
|
|
158
|
-
return dbConnection;
|
|
159
|
-
}
|
|
160
|
-
catch (error) {
|
|
161
|
-
console.error(`❌ Failed to connect to database for server ${serverId}:`, error);
|
|
162
|
-
throw error;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
async executeQuery(dbConnection, sqlQuery, args, operation) {
|
|
166
|
-
const { type, connection } = dbConnection;
|
|
167
|
-
try {
|
|
168
|
-
switch (type) {
|
|
169
|
-
case 'mssql':
|
|
170
|
-
const request = connection.request();
|
|
171
|
-
// Extract all @param references from the SQL query
|
|
172
|
-
const paramRegex = /@(\w+)/g;
|
|
173
|
-
let match;
|
|
174
|
-
const sqlParams = new Set();
|
|
175
|
-
while ((match = paramRegex.exec(sqlQuery)) !== null) {
|
|
176
|
-
sqlParams.add(match[1]);
|
|
177
|
-
}
|
|
178
|
-
// For SQL Server, handle data type compatibility issues
|
|
179
|
-
// If no filter parameters are provided (all are null), simplify the query
|
|
180
|
-
const hasActiveFilters = Array.from(sqlParams).some((paramName) => {
|
|
181
|
-
if (paramName === 'limit' || paramName === 'offset')
|
|
182
|
-
return false;
|
|
183
|
-
const value = args[paramName];
|
|
184
|
-
return value !== undefined && value !== null;
|
|
185
|
-
});
|
|
186
|
-
let modifiedQuery = sqlQuery;
|
|
187
|
-
if (!hasActiveFilters && operation === 'SELECT') {
|
|
188
|
-
// Remove complex WHERE clause that causes ntext compatibility issues
|
|
189
|
-
modifiedQuery = sqlQuery.replace(/WHERE.*?(?=ORDER BY|GROUP BY|HAVING|$)/gi, '');
|
|
190
|
-
}
|
|
191
|
-
// Always add all SQL parameters, using provided values or defaults
|
|
192
|
-
for (const paramName of sqlParams) {
|
|
193
|
-
const paramNameStr = paramName;
|
|
194
|
-
let value = args[paramNameStr];
|
|
195
|
-
// Set defaults for limit and offset if not provided
|
|
196
|
-
if (paramNameStr === 'limit' && (value === undefined || value === null)) {
|
|
197
|
-
value = 100;
|
|
198
|
-
}
|
|
199
|
-
else if (paramNameStr === 'offset' && (value === undefined || value === null)) {
|
|
200
|
-
value = 0;
|
|
201
|
-
}
|
|
202
|
-
if (value !== undefined && value !== null) {
|
|
203
|
-
request.input(paramNameStr, value);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
request.input(paramNameStr, null);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
const result = await request.query(modifiedQuery);
|
|
210
|
-
if (operation === 'SELECT') {
|
|
211
|
-
return result.recordset;
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
return { rowsAffected: result.rowsAffected[0] };
|
|
215
|
-
}
|
|
216
|
-
case 'mysql':
|
|
217
|
-
const [rows] = await connection.execute(sqlQuery, Object.values(args).filter(v => v !== undefined && v !== null));
|
|
218
|
-
if (operation === 'SELECT') {
|
|
219
|
-
return rows;
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
return { rowsAffected: rows.affectedRows };
|
|
223
|
-
}
|
|
224
|
-
case 'postgresql':
|
|
225
|
-
const values = Object.values(args).filter(v => v !== undefined && v !== null);
|
|
226
|
-
const pgResult = await connection.query(sqlQuery, values);
|
|
227
|
-
if (operation === 'SELECT') {
|
|
228
|
-
return pgResult.rows;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
return { rowsAffected: pgResult.rowCount };
|
|
232
|
-
}
|
|
233
|
-
default:
|
|
234
|
-
throw new Error(`Unsupported database type: ${type}`);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
catch (error) {
|
|
238
|
-
console.error(`❌ Database query failed:`, error);
|
|
239
|
-
throw error;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
getStats() {
|
|
243
|
-
return {
|
|
244
|
-
...this.sqliteManager.getStats(),
|
|
245
|
-
activeConnections: this.dbConnections.size
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
async close() {
|
|
249
|
-
// Close all database connections
|
|
250
|
-
for (const [serverId, dbConnection] of this.dbConnections.entries()) {
|
|
251
|
-
try {
|
|
252
|
-
switch (dbConnection.type) {
|
|
253
|
-
case 'mssql':
|
|
254
|
-
await dbConnection.connection.close();
|
|
255
|
-
break;
|
|
256
|
-
case 'mysql':
|
|
257
|
-
await dbConnection.connection.end();
|
|
258
|
-
break;
|
|
259
|
-
case 'postgresql':
|
|
260
|
-
await dbConnection.connection.end();
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
console.error(`🔌 Closed database connection for server ${serverId}`);
|
|
264
|
-
}
|
|
265
|
-
catch (error) {
|
|
266
|
-
console.error(`❌ Error closing connection for server ${serverId}:`, error);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
this.dbConnections.clear();
|
|
270
|
-
this.sqliteManager.close();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
exports.DynamicMCPExecutor = DynamicMCPExecutor;
|
|
274
|
-
//# sourceMappingURL=dynamic-mcp-executor.js.map
|