Vibe Coding

Learn how to connect Foldspace’s MCP server to AI code editors like Cursor, Windsurf, and VS Code to access and implement AI Actions directly in code

Using the Foldspace Model Context Protocol (MCP) server

This guide explains how to connect AI-powered code editors and clients to the Foldspace MCP server. This allows your AI assistant to understand and interact with your Foldspace AI Actions directly from your development environment.

What is the MCP Server?

The Model Context Protocol (MCP) is a standard for providing real-time, external context to AI models. The Foldspace MCP Server is our implementation of this standard, which securely exposes your Foldspace AI Actions as a set of callable tools.

By connecting your editor to this server, you give your AI assistant the ability to:

  • List all available AI Actions in your Foldspace account.
  • Get the detailed schema for any action, including its required parameters.
  • Generate boilerplate code for implementing an action handler in your application.

Prerequisites: Obtain your Foldspace API Key

Before connecting any client, you need your Foldspace API Key. This key authenticates your requests and allows the MCP server to access your specific set of AI Actions securely.

  1. Navigate to the Settings page within your Foldspace dashboard.
  2. Select Public API from the options.
  3. Generate a new API key and securely copy the provided token. You will need this token for the next step.

Important: Treat your API key like a password. Do not share it publicly or commit it to version control

Supported Clients

Cursor

Cursor is an AI-powered code editor built for productivity.

Configuration

  1. Open Cursor Settings: Navigate to Cursor > Settings > Cursor Settings.
  2. Add New MCP Server: Go to Tools & Integrations and click New MCP Server.
  3. Configure the Server: Add the following JSON configuration. Replace YOUR_API_KEY with the key you copied from the Foldspace dashboard.
{
  "mcpServers": {
    "foldspace-mcp-server": {
      "command": "npx",
      "args": [
        "@foldspace_npm/foldspace-mcp@latest", "YOUR_PUBLIC_API_KEY"
      ]
    }
  }
}
  1. Save Changes: Ensure you save the configuration file.

Windsurf

Open the Configuration Interface

  1. Launch Cascade.
  2. Click the hammer icon in the sidebar.
  3. Select Configure.









Updating the configuration file

  1. Click on View raw config
  2. Add the following JSON configuration to the MCP server settings:
    "foldspace-mcp-server": {
          "command": "npx",
          "args": [
            "@foldspace_npm/foldspace-mcp@latest", "<YOUR_PUBLIC_API_KEY>"
          ]
        }
    If you already have other MCP servers configured, append Foldspace like this:
    {
      "mcpServers": {
        "other-mcps": {
          "serverUrl": "https://other-mcps",
        },
        "foldspace-mcp-server": {
          "command": "npx",
          "args": [
            "@foldspace_npm/foldspace-mcp@latest", "<YOUR_PUBLIC_API_KEY>"
          ]
        }
      }
    }

After refresh you should be able to see the list of tools available


Visual Studio Code (GitHub Copilot)

You can connect GitHub Copilot in VS Code to the Foldspace MCP server to give it access to your AI Actions.

Configuration

  1. Enable MCP Support: Open VS Code Settings (Cmd+, on Mac or Ctrl+, on Windows/Linux). Search for "MCP" and ensure the GitHub > Copilot > Chat: MCP setting is enabled.
  2. Create Configuration File: At the root of your project workspace, create a new folder named .vscode. Inside that folder, create a file named mcp.json.
  3. Add Server Details: Paste the following JSON into your .vscode/mcp.json file, replacing YOUR_API_KEY with your Foldspace API key.
{
  "servers": {
    "foldspace-mcp-server": {
      "command": "npx",
      "args": [
        "@foldspace_npm/foldspace-mcp@latest", "<YOUR_PUBLIC_API_KEY>"
      ]
    }
  }
}
  1. Restart VS Code: Reload your VS Code window to ensure the configuration is loaded.

Usage In the GitHub Copilot Chat panel, you can now use # to see and reference the available tools from the Foldspace MCP server. Copilot will also intelligently use the tools when relevant to your queries.