feat(webui): expand MCP service presets (#6216)
* feat(webui): expand MCP service presets * refactor(webui): load MCP presets from JSON Validate and package the static service catalogue while preserving existing preset definitions. Pass Redis connection URLs through the official CLI option to retain target, TLS, database, and credential settings. * docs(mcp): include all built-in service presets
This commit is contained in:
1 parent
a482281092
commit
152abe7949
14 files changed
+3824
-408
No files matched your search
@@ -2172,6 +2172,8 @@ MCP servers can run locally over stdio or connect remotely over HTTP:
|
||||
|
||||
Remote HTTP servers may use browser OAuth instead of static headers. In the WebUI, open **Apps → MCP → Add MCP server**, choose **Custom**, select HTTP or SSE, and choose **OAuth** under **Authentication**. Save the server, then choose **Connect**. For manual configuration, add `auth: "oauth"` and open **Apps → MCP** to connect. Known presets such as Xmind, Notion, and Linear add the config automatically on first click.
|
||||
|
||||
The [MCP service presets](./mcp-presets.md) include hosted services with browser sign-in or API keys, plus local servers for Google Workspace, Microsoft 365, Firebase, and databases. Services such as Metabase and Sigma first ask for your instance or organization MCP URL. Credential fields accept the token itself; nanobot adds the required authorization header.
|
||||
|
||||
<details>
|
||||
<summary>Manual configuration</summary>
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ Restart nanobot and ask a question that requires the MCP tool.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
- [MCP service presets](../mcp-presets.md)
|
||||
- [MCP tools for AI agents](./mcp-tools-for-ai-agents.md)
|
||||
- [Configuration: MCP](../configuration.md#mcp-model-context-protocol)
|
||||
- [Security](../configuration.md#security)
|
||||
@@ -0,0 +1,185 @@
|
||||
# MCP service presets
|
||||
|
||||
Open **Apps → MCP** to find a service, configure its connection, and select **Connect**. Presets save MCP server configuration; the gateway discovers and runs the tools. Each service still requires its own account access and permissions. The tables below list all built-in presets.
|
||||
|
||||
## Hosted services
|
||||
|
||||
Browser sign-in uses the service's MCP OAuth flow. API-key presets ask for the credential listed below and add it to the required HTTP header or URL parameter. Paste the token itself into the credential field.
|
||||
|
||||
| Service | Authentication | Setup |
|
||||
| --- | --- | --- |
|
||||
| Browserbase | API key | [Official guide](https://docs.browserbase.com/integrations/mcp/setup) |
|
||||
| Firecrawl | None (keyless preset) | [Official guide](https://docs.firecrawl.dev/use-cases/developers-mcp) |
|
||||
| Parallel Search | None (anonymous access) | [Official guide](https://docs.parallel.ai/integrations/mcp/search-mcp) |
|
||||
| Exa | None | [Official guide](https://exa.ai/mcp) |
|
||||
| Microsoft Learn | None (public documentation) | [Official guide](https://learn.microsoft.com/en-us/training/support/mcp) |
|
||||
| Xmind | Browser OAuth | [Official guide](https://xmind.com/user-guide/xmind-mcp) |
|
||||
| Notion | Browser OAuth | [Official guide](https://developers.notion.com/guides/mcp/get-started-with-mcp) |
|
||||
| Linear | Browser OAuth | [Official guide](https://linear.app/docs/mcp) |
|
||||
| Stripe | Browser OAuth | [Official guide](https://docs.stripe.com/mcp) |
|
||||
| monday.com | Browser OAuth | [Official guide](https://developer.monday.com/api-reference/docs/mcp-dynamic-client-registration) |
|
||||
| ClickUp | Browser OAuth | [Official guide](https://developer.clickup.com/docs/connect-an-ai-assistant-to-clickups-mcp-server) |
|
||||
| Todoist | Browser OAuth | [Official guide](https://developer.todoist.com/api/v1/) |
|
||||
| Airtable | Browser OAuth | [Official guide](https://support.airtable.com/articles/9897799762-using-the-airtable-mcp-server) |
|
||||
| Miro | Browser OAuth | [Official guide](https://developers.miro.com/docs/connecting-to-miro-mcp) |
|
||||
| Whimsical | Browser OAuth | [Official guide](https://whimsical.com/learn/integrations/mcp) |
|
||||
| Figma (remote) | Browser OAuth | [Official guide](https://developers.figma.com/docs/figma-mcp-server/) |
|
||||
| Supabase (remote) | Browser OAuth | [Official guide](https://supabase.com/docs/guides/ai-tools/mcp) |
|
||||
| Neon | Browser OAuth | [Official guide](https://neon.com/docs/ai/neon-mcp-server) |
|
||||
| Vercel | Browser OAuth | [Official guide](https://vercel.com/docs/agent-resources/vercel-mcp) |
|
||||
| Render | API key or token | [Official guide](https://render.com/docs/mcp-server) |
|
||||
| Railway | Browser OAuth | [Official guide](https://docs.railway.com/ai/mcp-server) |
|
||||
| WordPress.com | Browser OAuth | [Official guide](https://developer.wordpress.com/docs/mcp/connect-custom-mcp-client/) |
|
||||
| Webflow | Browser OAuth | [Official guide](https://developers.webflow.com/mcp/reference/getting-started) |
|
||||
| Wix | Browser OAuth | [Official guide](https://dev.wix.com/docs/overview/ai-the-wix-platform/the-wix-mcp) |
|
||||
| Granola | Browser OAuth | [Official guide](https://help.granola.ai/article/granola-mcp) |
|
||||
| Fireflies | Browser OAuth | [Official guide](https://guide.fireflies.ai/articles/8272956938-learn-about-the-fireflies-mcp-server-model-context-protocol) |
|
||||
| Otter.ai | Browser OAuth | [Official guide](https://help.otter.ai/hc/en-us/articles/35287607569687-Otter-MCP-Server) |
|
||||
| Plaud | Browser OAuth | [Official guide](https://support.plaud.ai/hc/en-us/articles/57751078986265-Plaud-MCP) |
|
||||
| Read AI | Browser OAuth | [Official guide](https://support.read.ai/hc/en-us/articles/49381158409491-MCP-Server) |
|
||||
| Superhuman Mail | Browser OAuth | [Official guide](https://help.superhuman.com/hc/en-us/articles/46005696690317-Superhuman-Mail-MCP-Server) |
|
||||
| Calendly | Browser OAuth | [Official guide](https://developer.calendly.com/docs/mcp/calendly-mcp-server) |
|
||||
| Attio | Browser OAuth | [Official guide](https://attio.com/help/reference/how-to-guides/attio-mcp-prompts-and-best-practices) |
|
||||
| Close | Browser OAuth | [Official guide](https://developer.close.com/mcp) |
|
||||
| Apollo.io | Browser OAuth | [Official guide](https://docs.apollo.io/docs/apollo-mcp) |
|
||||
| Ashby | Browser OAuth | [Official guide](https://docs.ashbyhq.com/ashby-mcp-server-beta) |
|
||||
| Gusto | Browser OAuth | [Official guide](https://gusto.com/product/integrations/gusto_mcp) |
|
||||
| Ramp | Browser OAuth | [Official guide](https://support.ramp.com/ramp-mcp) |
|
||||
| Mercury | Browser OAuth | [Official guide](https://docs.mercury.com/docs/connecting-mercury-mcp) |
|
||||
| Higgsfield | Browser OAuth | [Official guide](https://higgsfield.ai/creator-hub/help-center/integrations/what-is-higgsfield-mcp) |
|
||||
| OpenArt | Browser OAuth | [Official guide](https://openart.ai/mcp/) |
|
||||
| Runway | Browser OAuth | [Official guide](https://help.runwayml.com/hc/en-us/articles/51931843164691-Connecting-to-Runway-MCP) |
|
||||
| PostHog | Browser OAuth | [Official guide](https://posthog.com/docs/model-context-protocol/codex) |
|
||||
| Amplitude | Browser OAuth | [Official guide](https://amplitude.com/docs/amplitude-ai/amplitude-mcp) |
|
||||
| Statsig | Browser OAuth | [Official guide](https://docs.statsig.com/integrations/mcp/manual-setup) |
|
||||
| Hex | Browser OAuth | [Official guide](https://learn.hex.tech/docs/api-integrations/mcp-server) |
|
||||
| MotherDuck | Browser OAuth | [Official guide](https://motherduck.com/docs/key-tasks/ai-and-motherduck/mcp-setup/) |
|
||||
| Consensus | Browser OAuth | [Official guide](https://docs.consensus.app/consensus-mcp) |
|
||||
| Scite | Browser OAuth | [Official guide](https://scite.ai/mcp) |
|
||||
| Tavily | Browser OAuth | [Official guide](https://docs.tavily.com/documentation/mcp) |
|
||||
| Atlassian | Browser OAuth | [Official guide](https://support.atlassian.com/atlassian-ai-gateway/docs/get-started-with-the-atlassian-remote-mcp-server/) |
|
||||
| Trello | Browser OAuth | [Official guide](https://support.atlassian.com/trello/docs/connect-trello-to-ai-assistants-with-trello-mcp/) |
|
||||
| Readwise | Browser OAuth | [Official guide](https://readwise.io/mcp) |
|
||||
| GitHub (remote) | API key or token | [Official guide](https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md) |
|
||||
| Coda | API key or token | [Official guide](https://help.coda.io/hc/en-us/articles/44722661982989-Connect-to-the-Coda-MCP) |
|
||||
| Deepnote | API key or token | [Official guide](https://deepnote.com/docs/deepnote-mcp) |
|
||||
| Hunter | API key or token | [Official guide](https://hunter.io/api-documentation) |
|
||||
| Ahrefs | API key or token | [Official guide](https://docs.ahrefs.com/en/mcp/docs/copilot-studio) |
|
||||
| AgentMail | API key or token | [Official guide](https://docs.agentmail.to/integrations/mcp) |
|
||||
| Similarweb | API key or token | [Official guide](https://developers.similarweb.com/docs/copilot-mcp-integration) |
|
||||
| Instacart | API key or token | [Official guide](https://docs.instacart.com/developer_platform_api/guide/tutorials/mcp/) |
|
||||
| Datadog | API key or token; service MCP URL required | [Official guide](https://docs.datadoghq.com/mcp_server/setup/) |
|
||||
| DigitalOcean | API key or token; service MCP URL required | [Official guide](https://docs.digitalocean.com/reference/mcp/configure-mcp/) |
|
||||
| Metabase | Browser OAuth; service MCP URL required | [Official guide](https://www.metabase.com/docs/latest/ai/mcp) |
|
||||
| Sigma | Browser OAuth; service MCP URL required | [Official guide](https://help.sigmacomputing.com/docs/use-sigma-mcp-server) |
|
||||
| Descript | Browser OAuth; service MCP URL required | [Official guide](https://help.descript.com/api-and-mcp/mcp) |
|
||||
| Hugging Face | Optional Hugging Face token | [Official guide](https://huggingface.co/docs/hub/agents-mcp) |
|
||||
| Wolfram | None | [Official guide](https://support.wolfram.com/75237) |
|
||||
| OpenAI Developers | None | [Official guide](https://developers.openai.com/learn/docs-mcp) |
|
||||
| Redis Docs | None | [Official guide](https://redis.io/docs/latest/develop/setup/build-with-an-agent/) |
|
||||
| Klaviyo | Browser OAuth | [Official guide](https://developers.klaviyo.com/en/docs/connect_to_the_klaviyo_mcp_server) |
|
||||
| Windsor.ai | Browser OAuth | [Official guide](https://windsor.ai/mcp/) |
|
||||
| Gong | Browser OAuth | [Official guide](https://help.gong.io/docs/create-an-integration-to-connect-to-the-mcp-server) |
|
||||
| MagicPath | Browser OAuth | [Official guide](https://github.com/MagicPathAI/magicpath-agent-plugin) |
|
||||
| WisdomAI | Browser OAuth | [Official guide](https://docs.wisdom.ai/integrations/mcp-server/MCP-Server) |
|
||||
| Mixpanel | Browser OAuth | [Official guide](https://docs.mixpanel.com/docs/mcp) |
|
||||
| HeyGen | Browser OAuth | [Official guide](https://www.heygen.com/model-context-protocol) |
|
||||
| TinyFish | Browser OAuth | [Official guide](https://docs.tinyfish.ai/mcp-integration/index) |
|
||||
| Vanta | Browser OAuth | [Official guide](https://developer.vanta.com/docs/vanta-mcp) |
|
||||
| Omni | Browser OAuth | [Official guide](https://docs.omni.co/ai/mcp/authentication) |
|
||||
| Metricool | Browser OAuth | [Official guide](https://help.metricool.com/how-to-connect-metricools-mcp-eqp9h) |
|
||||
| Supermetrics | Browser OAuth | [Official guide](https://docs.supermetrics.com/docs/supermetrics-mcp-server) |
|
||||
| Resend | Browser OAuth | [Official guide](https://github.com/resend/resend-mcp) |
|
||||
| Smartsheet | API token | [Official guide](https://developers.smartsheet.com/ai-mcp/smartsheet/install-the-smartsheet-mcp-server) |
|
||||
| Lusha | API key | [Official guide](https://docs.lusha.com/mcp/overview) |
|
||||
| Semrush | API key | [Official guide](https://developer.semrush.com/api/v3/introduction/semrush-mcp/) |
|
||||
| Blockscout | PRO API key | [Official guide](https://github.com/blockscout/mcp-server) |
|
||||
| Snowflake | Programmatic access token; service MCP URL required | [Official guide](https://www.snowflake.com/en/developers/guides/getting-started-with-snowflake-mcp-server/) |
|
||||
| Parallel Task | API key | [Official guide](https://docs.parallel.ai/integrations/mcp/task-mcp) |
|
||||
| Zoho CRM | Browser OAuth; service MCP URL required | [Official guide](https://www.zoho.com/crm/developer/docs/mcp/setup/claude.html) |
|
||||
| Wispr Flow | Browser OAuth | [Official guide](https://github.com/Wispr-AI/wispr-flow-plugin) |
|
||||
| GitBook | Browser OAuth | [Official guide](https://gitbook.com/docs/documentation/docs-as-code/gitbook-mcp) |
|
||||
| Floot | Browser OAuth | [Official guide](https://floot.com/docs/integrations/other-mcp-clients) |
|
||||
| Clay | Browser OAuth | [Official guide](https://university.clay.com/docs/connect-to-clay-mcp) |
|
||||
| WPWriter | Browser OAuth | [Official guide](https://www.wpwriter.com/html/abg_wp12.html) |
|
||||
| WPVibe | Browser OAuth | [Official guide](https://wpvibe.ai/connect/) |
|
||||
| vidIQ | Browser OAuth | [Official guide](https://support.vidiq.com/en/articles/15082430-vidiq-mcp) |
|
||||
| Caliber | Browser OAuth | [Official guide](https://caliberstrong.freshdesk.com/support/solutions/articles/48001282391-mcp-server-instructions) |
|
||||
| COROS | Browser OAuth | [Official guide](https://github.com/coroslab/COROS-MCP) |
|
||||
| Namecheap | Browser OAuth | [Official guide](https://www.namecheap.com/support/knowledgebase/article.aspx/10824/34/namecheap-mcp/) |
|
||||
| GoDaddy | None | [Official guide](https://developer.godaddy.com/en/docs/api-users/mcp) |
|
||||
| ThoughtSpot Developer | None | [Official guide](https://developers.thoughtspot.com/docs/SpotterCode) |
|
||||
| Hostinger Mail | API key or token | [Official guide](https://api.mail.hostinger.com/) |
|
||||
| GSC Wizard | API key or token | [Official guide](https://mcp.gscwizard.com/docs) |
|
||||
| Pocket AI | API key or token | [Official guide](https://docs.heypocketai.com/docs/mcp) |
|
||||
| Legal Data Hunter | Browser OAuth | [Official guide](https://legaldatahunter.com/llms.txt) |
|
||||
| RingCentral Phone | Browser OAuth | [Official guide](https://developers.ringcentral.com/mcp/servers/ringex-phone-setup/) |
|
||||
| Ubersuggest | Browser OAuth | [Official guide](https://ubersuggest-mcp.neilpatelapi.com/docs) |
|
||||
| Talarion Acumen | API key or token | [Official guide](https://docs.talarion.com/installation) |
|
||||
| Databricks Genie | API key or token; service MCP URL required | [Official guide](https://docs.databricks.com/aws/en/agents/mcp-tools/authentication-networking) |
|
||||
| TickTick | Browser OAuth | [Server metadata](https://mcp.ticktick.com/.well-known/oauth-protected-resource) |
|
||||
|
||||
Datadog uses the MCP endpoint for your Datadog site and a Personal or Service Access Token. DigitalOcean publishes separate endpoints for its services; copy the endpoint for the service you need. Metabase requires an instance with MCP enabled. Copy Sigma's URL from **Profile → Integrations** and Descript's URL from **Settings → Descript MCP**.
|
||||
|
||||
Figma uses the desktop app's local MCP endpoint, and Supabase starts a local server in read-only mode. Their **(remote)** variants use browser sign-in. GitHub uses Docker; **GitHub (remote)** uses a personal access token. Changes to credentials retain the connection's tool selection, timeout, and other saved settings.
|
||||
|
||||
## Local servers
|
||||
|
||||
Local servers run on the gateway computer. Install the runtime or application listed for each service. Stdio servers use a managed working directory under the nanobot data directory so their runtime files stay outside the source checkout. Figma connects over HTTP to the local desktop app.
|
||||
|
||||
| Service | Requirements | Setup |
|
||||
| --- | --- | --- |
|
||||
| Playwright | Node.js and npx | [Server guide](https://playwright.dev/docs/getting-started-mcp) |
|
||||
| Context7 | Node.js and npx; API key optional | [Server guide](https://context7.com/docs/resources/all-clients) |
|
||||
| AWS Documentation | uvx | [Server guide](https://awslabs.github.io/mcp/servers/aws-documentation-mcp-server/) |
|
||||
| Brave Search | Node.js, npx, and Brave Search API key | [Server guide](https://www.npmjs.com/package/@brave/brave-search-mcp-server) |
|
||||
| Postman | Node.js, npx, and Postman API key | [Server guide](https://learning.postman.com/docs/developer/postman-api/postman-mcp-server/postman-mcp-local-server) |
|
||||
| Figma | Figma desktop app with MCP enabled | [Server guide](https://help.figma.com/hc/en-us/articles/32132100833559-Guide-to-the-Figma-MCP-server) |
|
||||
| GitHub | Docker and GitHub token | [Server guide](https://github.com/github/github-mcp-server) |
|
||||
| Supabase | Node.js, npx, and Supabase access token | [Server guide](https://supabase.com/docs/guides/ai-tools/mcp) |
|
||||
| Firebase | Node.js, npx, and Firebase CLI sign-in | [Server guide](https://firebase.google.com/docs/ai-assistance/mcp-server) |
|
||||
| MongoDB | Node.js, npx, and MongoDB connection string | [Server guide](https://www.mongodb.com/docs/mcp-server/local-mcp/security-best-practices/) |
|
||||
| ClickHouse | uvx and ClickHouse connection credentials | [Server guide](https://github.com/ClickHouse/mcp-clickhouse) |
|
||||
| Redis | uvx and Redis connection URL | [Server guide](https://github.com/redis/mcp-redis) |
|
||||
| dbt | uvx and dbt account with a static subdomain | [Server guide](https://docs.getdbt.com/docs/dbt-ai/setup-local-mcp) |
|
||||
| Google Workspace | uvx and Google Cloud OAuth app with the required APIs enabled | [Server guide](https://github.com/taylorwilsdon/google_workspace_mcp) |
|
||||
| Microsoft 365 | Node.js, npx, and Microsoft work or school account | [Server guide](https://github.com/Softeria/ms-365-mcp-server) |
|
||||
| Adobe Express Developer | Node.js and npx | [Server guide](https://developer.adobe.com/express/add-ons/docs/guides/getting-started/local-development/mcp-server) |
|
||||
| Azure | Node.js, npx, Azure CLI, and Azure sign-in | [Server guide](https://github.com/microsoft/mcp/tree/main/servers/Azure.Mcp.Server) |
|
||||
| Tableau | Node.js 22.7.5 or later, npx, and Tableau personal access token | [Server guide](https://github.com/tableau/tableau-mcp) |
|
||||
| BigQuery | Node.js, npx, Google Application Default Credentials, and BigQuery access | [Server guide](https://docs.cloud.google.com/bigquery/docs/pre-built-tools-with-mcp-toolbox) |
|
||||
| Salesforce DX | Node.js, npx, Salesforce CLI, and an authorized default target org | [Server guide](https://developer.salesforce.com/docs/platform/sfdx-dev/guide/sfdx-dev-mcp-server.html) |
|
||||
| Shopify Developer | Node.js 18 or later and npx | [Server guide](https://shopify.dev/docs/apps/build/ai-toolkit) |
|
||||
| AWS | uvx, AWS CLI, configured IAM credentials, and AWS MCP permissions | [Server guide](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/getting-started-aws-mcp-server.html) |
|
||||
| Alation | uvx and Alation service-account integration | [Server guide](https://github.com/Alation/alation-ai-agent-sdk/tree/main/python/dist-mcp) |
|
||||
| Expedia Travel Recommendations | uvx and Expedia Travel Recommendations API key | [Server guide](https://github.com/ExpediaGroup/expedia-travel-recommendations-mcp) |
|
||||
|
||||
Google Workspace uses the community `workspace-mcp` server by Taylor Wilsdon. Create a Google Cloud OAuth app, enable the APIs you need, and follow the server's sign-in instructions. It provides Gmail, Drive, Calendar, Docs, Sheets, Slides, Contacts, and other Workspace tools. Microsoft 365 uses Softeria's community server for work or school accounts; ask its login tool to start the device-code flow. Tenant administrators may need to approve access. Personal Outlook accounts can use a custom configuration without `--org-mode`.
|
||||
|
||||
Firebase uses your Firebase CLI sign-in. The dbt server completes its own browser sign-in and requires an account with a static subdomain. MongoDB starts with `--readOnly`; ClickHouse uses HTTPS and read-only queries by default. Redis takes a connection URL such as `rediss://default:password@your-redis-host:6379/0`; use `rediss://` for TLS and the port supplied by your deployment.
|
||||
|
||||
Azure uses your Azure CLI sign-in. BigQuery uses Google Application Default Credentials and the project ID you provide. Salesforce DX uses your authorized default target org and enables its data, orgs, and metadata toolsets. AWS uses the official SigV4 proxy with your IAM credentials; its preset connects to the `us-east-1` managed endpoint. Alation uses a service-account integration. Tableau uses a personal access token and requires a site name for Tableau Cloud.
|
||||
|
||||
For Gong, a Tech admin must create an **Automatic** MCP integration and register nanobot's callback URL. Vanta requires an Admin account. Omni requires administrator-enabled AI, MCP, and personal access tokens. Supermetrics requires a subscription with API access. Zoho CRM provides separate server URLs for Data Insights, Data Operations, Module Customization, and Automation; copy the one you need from its setup guide.
|
||||
|
||||
Semrush's preset uses an API key and adds the `Apikey` authorization prefix. Snowflake requires a managed MCP server URL, a programmatic access token, and grants on the tools exposed by that server. Provider guides list regional alternatives for services whose presets use a US endpoint.
|
||||
|
||||
Clay workspace administrators must enable MCP and allow **Unknown** clients for dynamic registration. Databricks' access-token preset supports provided and registered MCP services for local testing; servers hosted on Databricks Apps require OAuth with a registered client. Pocket, Hostinger Mail, GSC Wizard, and Talarion use the API keys or tokens issued by their own account settings.
|
||||
|
||||
## Access and capability limits
|
||||
|
||||
A listing in another product's plugin directory does not supply a portable MCP URL or reusable credentials. Native OAuth presets require authorization-server discovery and dynamic client registration. Services that require a fixed OAuth client, client allowlisting, or additional onboarding need their own setup. This includes [Asana](https://developers.asana.com/docs/integrating-with-asanas-mcp-server), [HubSpot](https://developers.hubspot.com/docs/apps/developer-platform/build-apps/integrate-with-the-remote-hubspot-mcp-server), [Slack](https://docs.slack.dev/ai/slack-mcp-server/), [Canva](https://www.canva.dev/docs/apps/mcp/verify-app/), and [Dropbox](https://help.dropbox.com/integrations/connect-dropbox-mcp-server). Use a compatible local server or custom connection when you have completed the service's requirements.
|
||||
|
||||
Provider plans, quotas, enabled tools, and organization policies still apply. A configured connection is distinct from a connected runtime; test it from Apps to inspect the actual tool list. Tool access follows your provider permissions and nanobot's configured policy. [MCP configuration](./configuration.md#mcp-model-context-protocol) describes tool allowlists, timeouts, OAuth token storage, and private-host access.
|
||||
|
||||
OpenAI Developers, Redis Docs, and Adobe Express Developer provide documentation. They do not grant access to private OpenAI accounts, Redis databases, or Adobe designs. Instacart's Developer Platform server creates recipe pages and shopping lists; it does not reproduce the account-based shopping plugin. MCP tools also do not imply support for another host's embedded plugin UI.
|
||||
|
||||
Shopify Developer provides developer resources and validation; it does not supply an authenticated store-administration connection. The separate [Shop MCP](https://shopify.dev/changelog/posts/add-shopping-and-shop-pay-checkout-to-any-agent-with-shop-mcp) currently requires a protocol version unsupported by nanobot's MCP SDK. [tldraw's MCP App](https://tldraw.dev/blog/tldraw-mcp-app) depends on an embedded interactive canvas, which nanobot does not render.
|
||||
|
||||
[Box](https://developer.box.com/guides/box-mcp), [G2](https://documentation.g2.com/docs/g2-mcp-server), [Lovable](https://github.com/lovablelabs/mcp), and [Docusign](https://developers.docusign.com/platform/mcp-server/) require client-specific OAuth setup. [QuickBooks Online's local server](https://github.com/intuit/quickbooks-online-mcp-server) requires an Intuit OAuth app, an initial authorization handshake, and a local build. These services need a custom connection rather than a native browser-sign-in preset.
|
||||
|
||||
Expedia Travel Recommendations provides API-based travel recommendations and needs an Expedia API key. GoDaddy's preset searches public domain data. ThoughtSpot Developer provides documentation; its authenticated administrative endpoint needs a custom connection. [Zoom](https://developers.zoom.us/docs/mcp/servers/) and [Tredict](https://www.tredict.com/blog/mcp_server_docs/) also require provider-specific OAuth setup.
|
||||
|
||||
## Maintaining presets
|
||||
|
||||
The built-in catalogue is maintained in [`nanobot/webui/mcp_presets.json`](../nanobot/webui/mcp_presets.json). Each entry declares its server configuration and setup fields. Field types and defaults are defined in [`mcp_presets.py`](../nanobot/webui/mcp_presets.py); the gateway validates the catalogue when loading it. Add service connections to the JSON file and document their requirements here.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,55 @@
|
||||
"""Typed loader for the bundled MCP service catalogue."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from importlib.resources import files
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import TypeAdapter
|
||||
|
||||
from nanobot.config.schema import MCPServerConfig
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class McpPresetField:
|
||||
name: str
|
||||
label: str
|
||||
target: tuple[Literal["env", "url_param", "arg", "header", "url"], str]
|
||||
secret: bool = True
|
||||
required: bool = True
|
||||
env_var: str | None = None
|
||||
placeholder: str = ""
|
||||
value_prefix: str = ""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class McpPreset:
|
||||
name: str
|
||||
display_name: str
|
||||
category: str
|
||||
description: str
|
||||
docs_url: str
|
||||
transport: Literal["stdio", "streamableHttp", "sse", "oauth"]
|
||||
install_supported: bool
|
||||
brand_domain: str
|
||||
brand_color: str
|
||||
server: MCPServerConfig | None = None
|
||||
fields: tuple[McpPresetField, ...] = ()
|
||||
requires: str = ""
|
||||
note: str = ""
|
||||
|
||||
|
||||
def _parse_presets(data: str) -> tuple[McpPreset, ...]:
|
||||
presets = TypeAdapter(tuple[McpPreset, ...]).validate_json(data, strict=True, extra="forbid")
|
||||
names: set[str] = set()
|
||||
for preset in presets:
|
||||
if preset.name in names:
|
||||
raise ValueError(f"Duplicate MCP preset name: {preset.name}")
|
||||
names.add(preset.name)
|
||||
return presets
|
||||
|
||||
|
||||
MCP_PRESETS = _parse_presets(
|
||||
files("nanobot.webui").joinpath("mcp_presets.json").read_text(encoding="utf-8")
|
||||
)
|
||||
@@ -11,7 +11,6 @@ import shutil
|
||||
import urllib.parse
|
||||
from collections.abc import Awaitable, Callable
|
||||
from contextlib import suppress
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, Literal, Mapping, cast
|
||||
@@ -31,6 +30,7 @@ from nanobot.config.loader import load_config, resolve_config_env_vars, save_con
|
||||
from nanobot.config.paths import get_runtime_subdir
|
||||
from nanobot.config.schema import MCPServerConfig
|
||||
from nanobot.utils.helpers import ensure_dir
|
||||
from nanobot.webui.mcp_presets import MCP_PRESETS, McpPreset, McpPresetField
|
||||
|
||||
QueryParams = dict[str, list[str]]
|
||||
|
||||
@@ -74,399 +74,10 @@ class McpPresetError(Exception):
|
||||
self.status = status
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class McpPresetField:
|
||||
name: str
|
||||
label: str
|
||||
target: tuple[Literal["env", "url_param", "arg", "header"], str]
|
||||
secret: bool = True
|
||||
required: bool = True
|
||||
env_var: str | None = None
|
||||
placeholder: str = ""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class McpPreset:
|
||||
name: str
|
||||
display_name: str
|
||||
category: str
|
||||
description: str
|
||||
docs_url: str
|
||||
transport: Literal["stdio", "streamableHttp", "sse", "oauth"]
|
||||
install_supported: bool
|
||||
brand_domain: str
|
||||
brand_color: str
|
||||
server: MCPServerConfig | None = None
|
||||
fields: tuple[McpPresetField, ...] = ()
|
||||
requires: str = ""
|
||||
note: str = ""
|
||||
|
||||
|
||||
def _favicon_url(domain: str) -> str:
|
||||
return f"https://www.google.com/s2/favicons?domain={domain}&sz=64"
|
||||
|
||||
|
||||
MCP_PRESETS: tuple[McpPreset, ...] = (
|
||||
McpPreset(
|
||||
name="browserbase",
|
||||
display_name="Browserbase",
|
||||
category="browser",
|
||||
description="Cloud browser automation through Browserbase's hosted MCP server.",
|
||||
docs_url="https://docs.browserbase.com/integrations/mcp/setup",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="browserbase.com",
|
||||
brand_color="#111827",
|
||||
requires="Browserbase API key",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
url="https://mcp.browserbase.com/mcp",
|
||||
tool_timeout=60,
|
||||
),
|
||||
fields=(
|
||||
McpPresetField(
|
||||
name="browserbase_api_key",
|
||||
label="Browserbase API key",
|
||||
target=("url_param", "browserbaseApiKey"),
|
||||
env_var="BROWSERBASE_API_KEY",
|
||||
placeholder="bb_live_...",
|
||||
),
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="playwright",
|
||||
display_name="Playwright",
|
||||
category="browser",
|
||||
description="Local browser inspection and automation with Playwright's MCP server.",
|
||||
docs_url="https://playwright.dev/docs/getting-started-mcp",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="playwright.dev",
|
||||
brand_color="#2EAD33",
|
||||
requires="Node.js and npx",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="npx",
|
||||
args=["-y", "@playwright/mcp@latest"],
|
||||
tool_timeout=60,
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="context7",
|
||||
display_name="Context7",
|
||||
category="docs",
|
||||
description="Fetch current library docs and code examples while the agent works.",
|
||||
docs_url="https://context7.com/docs/resources/all-clients",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="context7.com",
|
||||
brand_color="#111827",
|
||||
requires="Node.js and npx; API key optional",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="npx",
|
||||
args=["-y", "@upstash/context7-mcp@latest"],
|
||||
tool_timeout=45,
|
||||
),
|
||||
fields=(
|
||||
McpPresetField(
|
||||
name="context7_api_key",
|
||||
label="Context7 API key",
|
||||
target=("arg", "--api-key"),
|
||||
env_var="CONTEXT7_API_KEY",
|
||||
placeholder="ctx7_...",
|
||||
required=False,
|
||||
),
|
||||
),
|
||||
note="Works without a key for basic public docs; add a key for higher limits or private docs.",
|
||||
),
|
||||
McpPreset(
|
||||
name="firecrawl",
|
||||
display_name="Firecrawl",
|
||||
category="web",
|
||||
description="Scrape, crawl, search, and extract web pages through Firecrawl's MCP server.",
|
||||
docs_url="https://docs.firecrawl.dev/use-cases/developers-mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="firecrawl.dev",
|
||||
brand_color="#EB5E28",
|
||||
requires="Network access",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
url="https://mcp.firecrawl.dev/v2/mcp",
|
||||
tool_timeout=60,
|
||||
),
|
||||
note=(
|
||||
"Uses Firecrawl Keyless through the hosted MCP endpoint. No API key is required for "
|
||||
"the built-in preset; use a custom MCP server URL if you want account-specific limits."
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="parallel-search",
|
||||
display_name="Parallel Search",
|
||||
category="web",
|
||||
description="Search the web and fetch relevant page content through Parallel's hosted MCP server.",
|
||||
docs_url="https://docs.parallel.ai/integrations/mcp/search-mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="parallel.ai",
|
||||
brand_color="#111827",
|
||||
requires="Network access",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
url="https://search.parallel.ai/mcp",
|
||||
tool_timeout=60,
|
||||
enabled_tools=["web_search", "web_fetch"],
|
||||
),
|
||||
note="Free anonymous access for light use; no API key is required.",
|
||||
),
|
||||
McpPreset(
|
||||
name="exa",
|
||||
display_name="Exa",
|
||||
category="web",
|
||||
description="Search the web and fetch clean page content through Exa's hosted MCP server.",
|
||||
docs_url="https://exa.ai/mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="exa.ai",
|
||||
brand_color="#101010",
|
||||
requires="Network access",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
url="https://mcp.exa.ai/mcp",
|
||||
tool_timeout=45,
|
||||
),
|
||||
note="Hosted Exa MCP endpoint currently does not require an API key.",
|
||||
),
|
||||
McpPreset(
|
||||
name="microsoft-learn",
|
||||
display_name="Microsoft Learn",
|
||||
category="docs",
|
||||
description="Search and fetch Microsoft Learn documentation through Microsoft's hosted MCP server.",
|
||||
docs_url="https://learn.microsoft.com/en-us/training/support/mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="learn.microsoft.com",
|
||||
brand_color="#0078D4",
|
||||
requires="Network access",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
url="https://learn.microsoft.com/api/mcp",
|
||||
tool_timeout=45,
|
||||
),
|
||||
note="Public documentation only; no authentication required.",
|
||||
),
|
||||
McpPreset(
|
||||
name="aws-docs",
|
||||
display_name="AWS Documentation",
|
||||
category="docs",
|
||||
description="Search AWS documentation and service guidance through AWS Labs' documentation MCP server.",
|
||||
docs_url="https://awslabs.github.io/mcp/servers/aws-documentation-mcp-server/",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="aws.amazon.com",
|
||||
brand_color="#FF9900",
|
||||
requires="uvx",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="uvx",
|
||||
args=["awslabs.aws-documentation-mcp-server@latest"],
|
||||
env={"FASTMCP_LOG_LEVEL": "ERROR", "AWS_DOCUMENTATION_PARTITION": "aws"},
|
||||
tool_timeout=60,
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="brave-search",
|
||||
display_name="Brave Search",
|
||||
category="web",
|
||||
description="Run web, news, image, video, and local search through Brave Search.",
|
||||
docs_url="https://www.npmjs.com/package/@brave/brave-search-mcp-server",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="brave.com",
|
||||
brand_color="#FB542B",
|
||||
requires="Node.js, npx, and Brave Search API key",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="npx",
|
||||
args=["-y", "@brave/brave-search-mcp-server@latest", "--transport", "stdio"],
|
||||
tool_timeout=45,
|
||||
),
|
||||
fields=(
|
||||
McpPresetField(
|
||||
name="brave_api_key",
|
||||
label="Brave Search API key",
|
||||
target=("env", "BRAVE_API_KEY"),
|
||||
env_var="BRAVE_API_KEY",
|
||||
placeholder="BSA...",
|
||||
),
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="postman",
|
||||
display_name="Postman",
|
||||
category="api",
|
||||
description="Inspect and manage Postman APIs, collections, and workspaces through the local MCP server.",
|
||||
docs_url="https://learning.postman.com/docs/developer/postman-api/postman-mcp-server/postman-mcp-local-server",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="postman.com",
|
||||
brand_color="#FF6C37",
|
||||
requires="Node.js, npx, and Postman API key",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="npx",
|
||||
args=["-y", "@postman/postman-mcp-server@latest", "--full"],
|
||||
tool_timeout=60,
|
||||
),
|
||||
fields=(
|
||||
McpPresetField(
|
||||
name="postman_api_key",
|
||||
label="Postman API key",
|
||||
target=("env", "POSTMAN_API_KEY"),
|
||||
env_var="POSTMAN_API_KEY",
|
||||
placeholder="PMAK-...",
|
||||
),
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="figma",
|
||||
display_name="Figma",
|
||||
category="design",
|
||||
description="Read design context from Figma using the local Dev Mode MCP server.",
|
||||
docs_url="https://help.figma.com/hc/en-us/articles/32132100833559-Guide-to-the-Figma-MCP-server",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="figma.com",
|
||||
brand_color="#F24E1E",
|
||||
requires="Figma desktop app with MCP enabled",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
url="http://127.0.0.1:3845/mcp",
|
||||
tool_timeout=45,
|
||||
),
|
||||
note="Requires Figma Desktop Dev Mode MCP to be running locally.",
|
||||
),
|
||||
McpPreset(
|
||||
name="xmind",
|
||||
display_name="Xmind",
|
||||
category="productivity",
|
||||
description="Create, read, and edit cloud mind maps through Xmind.",
|
||||
docs_url="https://xmind.com/user-guide/xmind-mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="xmind.com",
|
||||
brand_color="#F4B41A",
|
||||
requires="Xmind account",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
auth="oauth",
|
||||
url="https://app.xmind.com/api/mcp",
|
||||
tool_timeout=60,
|
||||
),
|
||||
note="Connects securely in your browser with Xmind OAuth.",
|
||||
),
|
||||
McpPreset(
|
||||
name="notion",
|
||||
display_name="Notion",
|
||||
category="productivity",
|
||||
description="Read and update your Notion workspace through Notion MCP.",
|
||||
docs_url="https://developers.notion.com/guides/mcp/get-started-with-mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="notion.so",
|
||||
brand_color="#111111",
|
||||
requires="Notion account",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
auth="oauth",
|
||||
url="https://mcp.notion.com/mcp",
|
||||
tool_timeout=60,
|
||||
),
|
||||
note="Connects securely in your browser with Notion OAuth.",
|
||||
),
|
||||
McpPreset(
|
||||
name="linear",
|
||||
display_name="Linear",
|
||||
category="productivity",
|
||||
description="Find and manage Linear issues, projects, and comments.",
|
||||
docs_url="https://linear.app/docs/mcp",
|
||||
transport="streamableHttp",
|
||||
install_supported=True,
|
||||
brand_domain="linear.app",
|
||||
brand_color="#5E6AD2",
|
||||
requires="Linear account",
|
||||
server=MCPServerConfig(
|
||||
type="streamableHttp",
|
||||
auth="oauth",
|
||||
url="https://mcp.linear.app/mcp",
|
||||
tool_timeout=60,
|
||||
),
|
||||
note="Connects securely in your browser with Linear OAuth.",
|
||||
),
|
||||
McpPreset(
|
||||
name="github",
|
||||
display_name="GitHub",
|
||||
category="code",
|
||||
description="Repository, issue, and pull request workflows via GitHub's MCP server.",
|
||||
docs_url="https://github.com/github/github-mcp-server",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="github.com",
|
||||
brand_color="#24292F",
|
||||
requires="Docker and GitHub token",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="docker",
|
||||
args=[
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"ghcr.io/github/github-mcp-server",
|
||||
],
|
||||
tool_timeout=60,
|
||||
),
|
||||
fields=(
|
||||
McpPresetField(
|
||||
name="github_token",
|
||||
label="GitHub token",
|
||||
target=("env", "GITHUB_PERSONAL_ACCESS_TOKEN"),
|
||||
env_var="GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
placeholder="ghp_...",
|
||||
),
|
||||
),
|
||||
),
|
||||
McpPreset(
|
||||
name="supabase",
|
||||
display_name="Supabase",
|
||||
category="database",
|
||||
description="Inspect and manage Supabase projects through the Supabase MCP server.",
|
||||
docs_url="https://supabase.com/docs/guides/ai-tools/mcp",
|
||||
transport="stdio",
|
||||
install_supported=True,
|
||||
brand_domain="supabase.com",
|
||||
brand_color="#3ECF8E",
|
||||
requires="Node.js, npx, and Supabase access token",
|
||||
server=MCPServerConfig(
|
||||
type="stdio",
|
||||
command="npx",
|
||||
args=["-y", "@supabase/mcp-server-supabase@latest", "--read-only"],
|
||||
tool_timeout=60,
|
||||
),
|
||||
fields=(
|
||||
McpPresetField(
|
||||
name="supabase_access_token",
|
||||
label="Supabase access token",
|
||||
target=("env", "SUPABASE_ACCESS_TOKEN"),
|
||||
env_var="SUPABASE_ACCESS_TOKEN",
|
||||
placeholder="sbp_...",
|
||||
),
|
||||
),
|
||||
note="MVP config starts read-only by default.",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def _query_first(query: QueryParams, key: str) -> str | None:
|
||||
@@ -631,7 +242,9 @@ def _field_value_from_config(field: McpPresetField, cfg: MCPServerConfig | None)
|
||||
return value if value else None
|
||||
if target_kind == "header":
|
||||
value = cfg.headers.get(target_name)
|
||||
return value if value else None
|
||||
return value.removeprefix(field.value_prefix) if value else None
|
||||
if target_kind == "url":
|
||||
return cfg.url or None
|
||||
if target_kind == "arg":
|
||||
return _arg_value(list(cfg.args), target_name)
|
||||
if target_kind == "url_param" and cfg.url:
|
||||
@@ -685,7 +298,7 @@ def _materialize_server(
|
||||
if preset.server is None or not preset.install_supported:
|
||||
raise McpPresetError(f"{preset.display_name} is not supported yet", status=409)
|
||||
|
||||
cfg = _clone_server(preset.server)
|
||||
cfg = _clone_server(existing or preset.server)
|
||||
for field_spec in preset.fields:
|
||||
value = _resolve_field_value(field_spec, query, existing)
|
||||
if field_spec.required and not value:
|
||||
@@ -696,11 +309,13 @@ def _materialize_server(
|
||||
if target_kind == "env":
|
||||
cfg.env[target_name] = value
|
||||
elif target_kind == "header":
|
||||
cfg.headers[target_name] = value
|
||||
cfg.headers[target_name] = field_spec.value_prefix + value
|
||||
elif target_kind == "arg":
|
||||
cfg.args = _with_arg_value(list(cfg.args), target_name, value)
|
||||
elif target_kind == "url_param":
|
||||
cfg.url = _url_with_param(cfg.url, target_name, value)
|
||||
elif target_kind == "url":
|
||||
cfg.url = value
|
||||
return _with_managed_stdio_cwd(preset.name, cfg)
|
||||
|
||||
|
||||
@@ -1528,11 +1143,16 @@ def ensure_mcp_oauth_server(
|
||||
name = _validated_server_name((_query_first(query, "name") or "").strip())
|
||||
config = load_config(config_path) if config_path is not None else load_config()
|
||||
cfg = config.tools.mcp_servers.get(name)
|
||||
if cfg is None:
|
||||
preset = _preset_by_name(name)
|
||||
preset = _preset_by_name_optional(name)
|
||||
fields_provided = preset is not None and any(
|
||||
_query_value(query, field.name) for field in preset.fields
|
||||
)
|
||||
if cfg is None or fields_provided:
|
||||
if preset is None:
|
||||
raise McpPresetError("unknown MCP preset", status=404)
|
||||
if preset.server is None or preset.server.auth != "oauth":
|
||||
raise McpPresetError("MCP server does not support browser authorization", status=409)
|
||||
cfg = _materialize_server(preset, query, None)
|
||||
cfg = _materialize_server(preset, query, cfg)
|
||||
config.tools.mcp_servers[name] = cfg
|
||||
save_config(config, config_path)
|
||||
if cfg.auth != "oauth" or cfg.type not in {"sse", "streamableHttp"} or not cfg.url:
|
||||
|
||||
@@ -135,6 +135,7 @@ allow-direct-references = true
|
||||
[tool.hatch.build]
|
||||
include = [
|
||||
"nanobot/**/*.py",
|
||||
"nanobot/webui/mcp_presets.json",
|
||||
"nanobot/templates/**/*.md",
|
||||
"nanobot/skills/**/*.md",
|
||||
"nanobot/skills/**/*.sh",
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from nanobot.webui.mcp_presets import _parse_presets
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def preset_data() -> dict:
|
||||
return {
|
||||
"name": "example",
|
||||
"display_name": "Example",
|
||||
"category": "docs",
|
||||
"description": "Search example documentation.",
|
||||
"docs_url": "https://example.com/docs",
|
||||
"transport": "streamableHttp",
|
||||
"install_supported": True,
|
||||
"brand_domain": "example.com",
|
||||
"brand_color": "#111827",
|
||||
"server": {"type": "streamableHttp", "url": "https://example.com/mcp"},
|
||||
"fields": [{"name": "api_key", "label": "API key", "target": ["header", "Authorization"]}],
|
||||
}
|
||||
|
||||
|
||||
def test_json_presets_keep_credential_and_tool_defaults(preset_data: dict) -> None:
|
||||
preset, = _parse_presets(json.dumps([preset_data]))
|
||||
|
||||
assert preset.fields[0].secret is True
|
||||
assert preset.fields[0].required is True
|
||||
assert preset.fields[0].target == ("header", "Authorization")
|
||||
assert preset.server is not None
|
||||
assert preset.server.enabled_tools == ["*"]
|
||||
|
||||
|
||||
def test_json_presets_reject_duplicate_names(preset_data: dict) -> None:
|
||||
with pytest.raises(ValueError, match="Duplicate MCP preset name: example"):
|
||||
_parse_presets(json.dumps([preset_data, preset_data]))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("invalid_part", ["field_target", "server_key", "boolean"])
|
||||
def test_json_presets_reject_invalid_configuration(preset_data: dict, invalid_part: str) -> None:
|
||||
if invalid_part == "field_target":
|
||||
preset_data["fields"][0]["target"] = ["query", "Authorization"]
|
||||
elif invalid_part == "server_key":
|
||||
preset_data["server"]["tool_timout"] = 60
|
||||
else:
|
||||
preset_data["fields"][0]["secret"] = "false"
|
||||
|
||||
with pytest.raises(ValidationError):
|
||||
_parse_presets(json.dumps([preset_data]))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("target", ["wheel", "sdist"])
|
||||
def test_distributions_bundle_mcp_preset_resource(tmp_path: Path, target: str) -> None:
|
||||
repository = Path(__file__).resolve().parents[2]
|
||||
for name in ("pyproject.toml", "README.md", "LICENSE", "THIRD_PARTY_NOTICES.md"):
|
||||
shutil.copyfile(repository / name, tmp_path / name)
|
||||
package = tmp_path / "nanobot/webui"
|
||||
package.mkdir(parents=True)
|
||||
(tmp_path / "nanobot/__init__.py").write_text("", encoding="utf-8")
|
||||
(package / "__init__.py").write_text("", encoding="utf-8")
|
||||
resource = "nanobot/webui/mcp_presets.json"
|
||||
expected = (repository / resource).read_bytes()
|
||||
(tmp_path / resource).write_bytes(expected)
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-c", f"import hatchling.build; hatchling.build.build_{target}('dist')"],
|
||||
cwd=tmp_path,
|
||||
env={**os.environ, "HATCH_BUILD_NO_HOOKS": "1"},
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
assert result.returncode == 0, result.stdout + result.stderr
|
||||
|
||||
if target == "wheel":
|
||||
with ZipFile(next((tmp_path / "dist").glob("*.whl"))) as wheel:
|
||||
assert wheel.read(resource) == expected
|
||||
else:
|
||||
with tarfile.open(next((tmp_path / "dist").glob("*.tar.gz"))) as sdist:
|
||||
member = next(name for name in sdist.getnames() if name.endswith(f"/{resource}"))
|
||||
bundled = sdist.extractfile(member)
|
||||
assert bundled is not None
|
||||
with bundled:
|
||||
assert bundled.read() == expected
|
||||
@@ -15,6 +15,7 @@ from nanobot.config.schema import Config
|
||||
from nanobot.webui.mcp_presets_api import (
|
||||
McpPresetError,
|
||||
custom_mcp_action,
|
||||
ensure_mcp_oauth_server,
|
||||
mcp_presets_action,
|
||||
mcp_presets_payload,
|
||||
mcp_presets_settings_action,
|
||||
@@ -276,6 +277,175 @@ def test_enable_browserbase_writes_scrubbed_config_payload(
|
||||
assert "browserbaseApiKey=bb_live_secret" in config.tools.mcp_servers["browserbase"].url
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("name", "field", "header", "expected"),
|
||||
[
|
||||
("deepnote", "deepnote_api_key", "Authorization", "Bearer preset-test-secret"),
|
||||
("agentmail", "agentmail_api_key", "x-api-key", "preset-test-secret"),
|
||||
],
|
||||
)
|
||||
def test_service_key_survives_reconnect_without_leaking_to_catalog(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
name: str,
|
||||
field: str,
|
||||
header: str,
|
||||
expected: str,
|
||||
) -> None:
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
payload = mcp_presets_action("enable", {"name": [name], field: ["preset-test-secret"]})
|
||||
assert load_config().tools.mcp_servers[name].headers[header] == expected
|
||||
assert "preset-test-secret" not in json.dumps(payload)
|
||||
|
||||
config = load_config()
|
||||
config.tools.mcp_servers[name].enabled_tools = ["search"]
|
||||
config.tools.mcp_servers[name].tool_timeout = 90
|
||||
save_config(config)
|
||||
|
||||
payload = mcp_presets_action("enable", {"name": [name]})
|
||||
saved = load_config().tools.mcp_servers[name]
|
||||
assert saved.headers[header] == expected
|
||||
assert saved.enabled_tools == ["search"]
|
||||
assert saved.tool_timeout == 90
|
||||
assert next(row for row in payload["presets"] if row["name"] == name)["configured"]
|
||||
|
||||
|
||||
def test_service_bearer_key_resolves_environment_reference(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
from nanobot.config.loader import resolve_config_env_vars
|
||||
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
monkeypatch.setenv("DEEPNOTE_API_KEY", "environment-test-secret")
|
||||
payload = mcp_presets_action("enable", {"name": ["deepnote"]})
|
||||
|
||||
config = load_config()
|
||||
assert config.tools.mcp_servers["deepnote"].headers == {
|
||||
"Authorization": "Bearer ${DEEPNOTE_API_KEY}"
|
||||
}
|
||||
resolved = resolve_config_env_vars(config)
|
||||
assert resolved.tools.mcp_servers["deepnote"].headers == {
|
||||
"Authorization": "Bearer environment-test-secret"
|
||||
}
|
||||
assert "environment-test-secret" not in json.dumps(payload)
|
||||
|
||||
|
||||
def test_account_endpoint_and_token_are_saved_together(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
payload = mcp_presets_action(
|
||||
"enable",
|
||||
{
|
||||
"name": ["datadog"],
|
||||
"mcp_url": ["https://mcp.example.com/datadog"],
|
||||
"datadog_access_token": ["datadog-test-secret"],
|
||||
},
|
||||
)
|
||||
|
||||
saved = load_config().tools.mcp_servers["datadog"]
|
||||
assert saved.url == "https://mcp.example.com/datadog"
|
||||
assert saved.headers == {"Authorization": "Bearer datadog-test-secret"}
|
||||
row = next(item for item in payload["presets"] if item["name"] == "datadog")
|
||||
assert row["configured"] is True
|
||||
assert row["connection_summary"] == saved.url
|
||||
assert "datadog-test-secret" not in json.dumps(payload)
|
||||
|
||||
|
||||
def test_instance_oauth_setup_saves_endpoint_before_authorization(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
name, cfg = ensure_mcp_oauth_server(
|
||||
{"name": ["metabase"], "mcp_url": ["https://analytics.example.com/api/metabase-mcp"]}
|
||||
)
|
||||
assert name == "metabase"
|
||||
assert cfg.auth == "oauth"
|
||||
assert cfg.url == "https://analytics.example.com/api/metabase-mcp"
|
||||
row = next(item for item in mcp_presets_payload()["presets"] if item["name"] == name)
|
||||
assert row["installed"] is True
|
||||
assert row["status"] == "authorization_required"
|
||||
|
||||
config = load_config()
|
||||
config.tools.mcp_servers[name].enabled_tools = ["search"]
|
||||
save_config(config)
|
||||
_, updated = ensure_mcp_oauth_server(
|
||||
{"name": [name], "mcp_url": ["https://other.example.com/api/metabase-mcp"]}
|
||||
)
|
||||
assert updated.url == "https://other.example.com/api/metabase-mcp"
|
||||
assert updated.enabled_tools == ["search"]
|
||||
assert load_config().tools.mcp_servers[name].url == updated.url
|
||||
|
||||
|
||||
def test_instance_oauth_setup_requires_endpoint_without_saving_empty_connection(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
with pytest.raises(McpPresetError, match="missing MCP server URL"):
|
||||
ensure_mcp_oauth_server({"name": ["metabase"]})
|
||||
assert load_config().tools.mcp_servers == {}
|
||||
|
||||
|
||||
def test_google_workspace_uses_managed_stdio_and_environment_credentials(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
payload = mcp_presets_action(
|
||||
"enable",
|
||||
{
|
||||
"name": ["google-workspace"],
|
||||
"google_client_id": ["test.apps.googleusercontent.com"],
|
||||
"google_client_secret": ["google-test-secret"],
|
||||
},
|
||||
)
|
||||
|
||||
saved = load_config().tools.mcp_servers["google-workspace"]
|
||||
assert saved.command == "uvx"
|
||||
assert saved.args == ["workspace-mcp", "--transport", "stdio", "--tool-tier", "core"]
|
||||
assert saved.env == {
|
||||
"GOOGLE_OAUTH_CLIENT_ID": "test.apps.googleusercontent.com",
|
||||
"GOOGLE_OAUTH_CLIENT_SECRET": "google-test-secret",
|
||||
}
|
||||
assert Path(saved.cwd) == tmp_path / "mcp" / "google-workspace"
|
||||
assert "google-test-secret" not in json.dumps(payload)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("from_environment", [False, True])
|
||||
def test_redis_url_is_passed_to_cli_and_kept_secret(
|
||||
tmp_path,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
from_environment: bool,
|
||||
) -> None:
|
||||
from nanobot.config.loader import resolve_config_env_vars
|
||||
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
url = "rediss://default:redis-test-secret@cache.example.com:16380/3"
|
||||
query = {"name": ["redis"]}
|
||||
if from_environment:
|
||||
monkeypatch.setenv("REDIS_URL", url)
|
||||
else:
|
||||
query["redis_url"] = [url]
|
||||
|
||||
payload = mcp_presets_action("enable", query)
|
||||
config = load_config()
|
||||
saved = config.tools.mcp_servers["redis"]
|
||||
assert saved.args == [
|
||||
"--from", "redis-mcp-server@latest", "redis-mcp-server", "--url",
|
||||
"${REDIS_URL}" if from_environment else url,
|
||||
]
|
||||
resolved = resolve_config_env_vars(config)
|
||||
assert resolved.tools.mcp_servers["redis"].args[-1] == url
|
||||
row = next(item for item in payload["presets"] if item["name"] == "redis")
|
||||
assert row["configured"] is True
|
||||
assert row["required_fields"][0]["secret"] is True
|
||||
assert "redis-test-secret" not in json.dumps(payload)
|
||||
|
||||
|
||||
def test_enable_requires_missing_secret(tmp_path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
_use_config(tmp_path, monkeypatch)
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ export function AppsCatalogSettings({
|
||||
onFilterChange: (value: AppsKindFilter) => void;
|
||||
onCliAction: (action: "install" | "update" | "uninstall" | "test", name: string) => void;
|
||||
onMcpAction: (action: "enable" | "disable" | "remove" | "test" | "reconnect", name: string, values?: Record<string, string>) => void;
|
||||
onMcpOAuthConnect: (name: string, reset?: boolean) => void;
|
||||
onMcpOAuthConnect: (name: string, reset?: boolean, values?: Record<string, string>) => void;
|
||||
onMcpOAuthCancel: () => void;
|
||||
onMcpOAuthOpen: () => void;
|
||||
onMcpOAuthCallbackUrlChange: (value: string) => void;
|
||||
@@ -526,7 +526,7 @@ function McpAppsCatalogRow({
|
||||
showTypeBadge: boolean;
|
||||
onFieldChange: (presetName: string, fieldName: string, value: string) => void;
|
||||
onAction: (action: "enable" | "disable" | "remove" | "test" | "reconnect", name: string, values?: Record<string, string>) => void;
|
||||
onOAuthConnect: (name: string, reset?: boolean) => void;
|
||||
onOAuthConnect: (name: string, reset?: boolean, values?: Record<string, string>) => void;
|
||||
onOAuthCancel: () => void;
|
||||
onOAuthOpen: () => void;
|
||||
onOAuthCallbackUrlChange: (value: string) => void;
|
||||
@@ -582,15 +582,15 @@ function McpAppsCatalogRow({
|
||||
const callbackErrorId = `${callbackInputId}-error`;
|
||||
|
||||
const enableOrOpenSetup = () => {
|
||||
if (isOAuth) {
|
||||
onOAuthConnect(preset.name);
|
||||
return;
|
||||
}
|
||||
if (needsSetupInput || (preset.installed && !preset.configured && hasFields)) {
|
||||
setManagementTab("connection");
|
||||
setManagementOpen(true);
|
||||
return;
|
||||
}
|
||||
if (isOAuth) {
|
||||
onOAuthConnect(preset.name);
|
||||
return;
|
||||
}
|
||||
onAction("enable", preset.name, values);
|
||||
};
|
||||
const openManagement = (tab: McpManagementTab = "overview") => {
|
||||
@@ -732,7 +732,7 @@ function McpAppsCatalogRow({
|
||||
visibleLabel={tx("settings.mcp.setup", "Connect")}
|
||||
busy={oauthBusy}
|
||||
disabled={anotherOAuthBusy}
|
||||
onClick={() => onOAuthConnect(preset.name)}
|
||||
onClick={enableOrOpenSetup}
|
||||
/>
|
||||
) : preset.installed && !preset.configured ? (
|
||||
<AppsActionButton
|
||||
|
||||
@@ -34,7 +34,7 @@ interface McpManagementDialogProps {
|
||||
onOpenChange: (open: boolean) => void;
|
||||
onFieldChange: (presetName: string, fieldName: string, value: string) => void;
|
||||
onAction: (action: McpAction, name: string, values?: Record<string, string>) => void;
|
||||
onOAuthConnect: (name: string, reset?: boolean) => void;
|
||||
onOAuthConnect: (name: string, reset?: boolean, values?: Record<string, string>) => void;
|
||||
onToolsChange: (name: string, enabledTools: string[]) => void;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ export function McpManagementDialog({
|
||||
const connect = () => {
|
||||
onOpenChange(false);
|
||||
if (isOAuth) {
|
||||
onOAuthConnect(preset.name, configuredInstalled);
|
||||
onOAuthConnect(preset.name, configuredInstalled, values);
|
||||
return;
|
||||
}
|
||||
onAction(configuredInstalled ? "reconnect" : "enable", preset.name, values);
|
||||
|
||||
@@ -458,7 +458,11 @@ export function createSystemSettingsActions({
|
||||
}
|
||||
};
|
||||
|
||||
const handleMcpOAuthConnect = async (name: string, reset = false) => {
|
||||
const handleMcpOAuthConnect = async (
|
||||
name: string,
|
||||
reset = false,
|
||||
values: Record<string, string> = {},
|
||||
) => {
|
||||
openMcpOAuthPopup();
|
||||
const key = `oauth:${name}`;
|
||||
setMcpPresetAction(key);
|
||||
@@ -468,7 +472,7 @@ export function createSystemSettingsActions({
|
||||
setMcpOAuthCompleting(false);
|
||||
setMcpOAuthCallbackError(null);
|
||||
try {
|
||||
const flow = await startMcpOAuth(client, name, reset);
|
||||
const flow = await startMcpOAuth(client, name, reset, values);
|
||||
mcpOAuthFlowRef.current = flow;
|
||||
setMcpOAuthFlow(flow);
|
||||
navigateMcpOAuthPopup(flow);
|
||||
|
||||
@@ -1000,11 +1000,12 @@ export async function startMcpOAuth(
|
||||
transport: WebUIMutationTransport,
|
||||
name: string,
|
||||
reset: boolean = false,
|
||||
values: Record<string, string> = {},
|
||||
): Promise<McpOAuthFlowPayload> {
|
||||
return mutation<McpOAuthFlowPayload>(
|
||||
transport,
|
||||
"settings.mcp.oauth_start",
|
||||
{ name, ...(reset ? { reset: true } : {}) },
|
||||
{ ...values, name, ...(reset ? { reset: true } : {}) },
|
||||
30_000,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,62 @@ const xmindMcpPreset = {
|
||||
describe("SettingsView Apps catalog", () => {
|
||||
installSettingsViewTestHooks();
|
||||
|
||||
it("collects an instance MCP URL before starting browser authorization", async () => {
|
||||
const metabasePreset = {
|
||||
...xmindMcpPreset,
|
||||
name: "metabase",
|
||||
display_name: "Metabase",
|
||||
description: "Query analytics in your Metabase instance.",
|
||||
required_fields: [{
|
||||
name: "mcp_url",
|
||||
label: "MCP server URL",
|
||||
secret: false,
|
||||
required: true,
|
||||
configured: false,
|
||||
placeholder: "https://analytics.example.com/api/metabase-mcp",
|
||||
env_var: null,
|
||||
}],
|
||||
};
|
||||
vi.stubGlobal("fetch", vi.fn(async (input: RequestInfo | URL) => {
|
||||
const url = String(input);
|
||||
if (url === "/api/settings") return jsonResponse(settingsPayload());
|
||||
if (url === "/api/settings/cli-apps") return jsonResponse({ apps: [], installed_count: 0 });
|
||||
if (url === "/api/settings/mcp-presets") {
|
||||
return jsonResponse({ presets: [metabasePreset], installed_count: 0 });
|
||||
}
|
||||
return { ok: false, status: 404, text: async () => "Not found" } as Response;
|
||||
}));
|
||||
vi.stubGlobal("open", vi.fn(() => null));
|
||||
requestMutationMock.mockResolvedValue({
|
||||
flow_id: "flow-metabase",
|
||||
name: "metabase",
|
||||
status: "failed",
|
||||
error: "Stopped after the authorization request.",
|
||||
expires_in: 300,
|
||||
});
|
||||
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Metabase" }));
|
||||
|
||||
const dialog = await screen.findByRole("dialog", { name: "Metabase" });
|
||||
const connect = within(dialog).getByRole("button", { name: "Connect" });
|
||||
expect(connect).toBeDisabled();
|
||||
fireEvent.change(within(dialog).getByRole("textbox", { name: "MCP server URL" }), {
|
||||
target: { value: "https://analytics.example.com/api/metabase-mcp" },
|
||||
});
|
||||
expect(connect).toBeEnabled();
|
||||
await act(async () => fireEvent.click(connect));
|
||||
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.mcp.oauth_start",
|
||||
{ name: "metabase", mcp_url: "https://analytics.example.com/api/metabase-mcp" },
|
||||
expect.any(Number),
|
||||
));
|
||||
});
|
||||
|
||||
|
||||
|
||||
it("connects an OAuth MCP from the Apps catalog without manual callback input", async () => {
|
||||
let connected = false;
|
||||
const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
|
||||
|
||||
Reference in new issue
Block a user