Databutton
DiscordSign up
  • Getting Started
    • Databutton University
    • Meet the Databutton AI agent
  • Help & FAQ
  • Prompting in Databutton
    • Top prompting strategies
    • Prompting app UI & design
    • Prompting up your backend (APIs)
    • Troubleshooting prompt
    • Connecting UI with the Backend
    • Prompt Gallery
  • Using Tasks
    • How to use tasks in Databutton
    • Writing a good task
    • Chaining tasks
  • Task Gallery
  • Integrating SaaS Services
    • Authentication Integration
      • Firebase Integration
      • Supabase Integration
    • Working with Firestore Database
    • Working with Supabase Table
    • Stripe Integration
  • App Configurations
    • Package Installations
    • Managing Secrets
    • Customising Agent Behavior
    • Invite Collaborators
    • Opening Dev APIs
    • Customising App Design
  • Tutorials
    • Configuring a custom domain for your app
  • Databutton MCP – Build tools for AI
  • Troubleshooting
    • Browser window crashes
Powered by GitBook
On this page
  • Enabling MCP in your app
  • Building your first tool
  • Connecting from Claude Desktop
  • Verify the setup
  • Troubleshooting
  • Unable to get the client to connect to your MCP

Was this helpful?

Databutton MCP – Build tools for AI

MCP, or Model Context Protocol, is a way to provide tools for AI agents and LLMs. All Databutton apps can now be fully custom MCP servers (provides the exact tools that your business needs to an LLM).

PreviousConfiguring a custom domain for your appNextBrowser window crashes

Last updated 2 months ago

Was this helpful?

The Databutton agent can build full-stack apps with React front ends and Python back ends. This means you can create fully tailored tools both for people (UIs) and other applications (APIs).

Now you can do the same thing with MCP, or agent tools.

You can enable MCP in your Databutton app, which will automatically turn the APIs from app into an MCP server when deployed.

Lets look at how you build your first MCP server and how connect to it from an MCP client, such as Claude Desktop or Cursor.

Don't know about MCP? You can read Anthropic's docs and a high level primer . MCP is still in its early days, but OpenAI has now also adopted it, so we expect its popularity and use cases to just skyrocket over time.

Enabling MCP in your app

You can make any Databutton app into an MCP server.

Inside your Databutton app, go to Settings -> Production and click the "Enable MCP" button.

MCP servers are usually locally running on your machine, but we will host them for you to remove hassle and allow you to distribute them.

You will get an API key that you need to connect to the hosted MCP server. The next time you deploy your app, your APIs will be available as tools in the MCP server.

Building your first tool

Building tools in your MCP is just like building APIs in your Databutton app. You can even use the same API for your app's UI and as a tool in your MCP.

To provide the MCP client with more context about the tools you make, we recommend telling the Databutton agent to add Python docs to your endpoint. This will be included as part of the tool and thus serves as instructions for your agent on how to use the tool.

Remember to "Deploy" your app whenever you have new endpoints created (that you want shown in the Databutton MCP server). However, if your endpoints are the same and you generated a new key, you need not deploy your app again (after doing it the first time).

The tools you build in your MCP will give the MCP client (or AI agent) those capabilities. Having Python docs for each endpoint gives that client context to determine when, how, and why to use those capabilities. Simply tell the agent "Generate Python docs for #<endpoint_name>".

Connecting from Claude Desktop

Prerequisites

Note: To run the installation command from Homebrew, press Command + Space, type "terminal", and paste the text from Homebrew into the "terminal" application. The command from Homebrew should look like the following: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". Click enter to run.

  1. Open your Command Prompt (in your Windows search bar, type and select "Command Prompt").

  2. Run (type and click enter in Command Prompt) where node and npm root -g and note down the outputs. You should see similar outputs as the following:

    1. where node — C:\Program Files\nodejs\node.exe

    2. npm root -g — C:\Users\USERNAME\AppData\Roaming\npm\node_modules

  3. Add the outputs (or paths) to your system environment variables.

    1. In your Windows search bar, type "environment variables" and select "Edit the system environment variables".

    2. Click on Advanced -> Environment Variables

    3. Navigate to the "System variables" section, double click on "Path", and select "New"

    4. Add the paths as separate lines and click "Ok" to save.

  4. Open Command Prompt as administrator and run the command npm install -g uv.

Open Claude Desktop, go to Settings -> Developer and click "Edit Config".

This will open up a file with name claude_desktop_config.json

In this file, add the following config. This will add a MCP server to your settings called databutton-app . Remember to replace <your-api-key>with the key generated in your Databutton app.

claude_desktop_config.json
{
  "mcpServers": {
    "databutton-app": {
      "command": "uvx",
      "args": [
        "databutton-app-mcp@latest"
      ],
      "env": {
        "DATABUTTON_API_KEY": "<your-api-key>"
      }
    }
  },
  "globalShortcut": ""
}

Note: If you already are using an MCP server, add the databutton-app MCP to the list of MCP servers.

Verify the setup

After configuring the MCP, restart Claude for the changes to take effect. If you entered the config correctly you should see the server running under the Developer pane and in the chat input you should see a hammer icon indicating number of tools from your MCP(s).

Troubleshooting

You see "MCP databutton-app: spawn uvx ENOENT" when you launch Claude

If you see an error such as the one in the screenshot below when you start Claude it usually indicates that you either don't have uvinstalled or that your uvinstallation is not available to Claude.

This is resolved by installing uv using Homebrew with this command

brew install uv

Restart Claude Desktop once you're done.

If you see an error such as the following, click "Open MCP Settings" > "Open Logs Folder". Open the file called "mcp-server-databutton-app" and scroll to the bottom of the file. The last few lines will reflect the most recent events. Sharing these with us on Intercom will help us help you fix the issue quicker.

Unable to get the client to connect to your MCP

If you're unable to connect to the MCP after following this guide, contact us through the Discord community and we'll try to help you out.

Have both and installed.

Have both and installed.

Install . Make sure to select "Add Python to Path" during installation. Open Command Prompt again and run where Python . Take the output and run through steps 4a to 4d with the output to add Python into your environment variables.

Ensure you have uv installed. See under above for instructions.

Look for the error "MCP databutton-app: Server disconnected."
here
here
Claude Desktop
Homebrew
Claude Desktop
Node.js (v18.x or later)
Python
"Connecting from Claude Desktop" > "Prerequisites"
Hover over the Hammer icon to see the tools you have available. Databutton tools should have something like "server: databutton-.."
Look for the error "MCP databutton-app: spawn uvx ENOENT"