# Vibe Coding

Integrate Foldspace from your AI coding tool — install the plugin, add the public Docs MCP for instant documentation search, or connect the Product MCP to Cursor, Claude Code, Windsurf, and VS Code to build AI Actions in code.

Wire Foldspace up from the AI coding tool you already use. The fastest path is the Foldspace
plugin — your coding agent adds the agent, connects your authenticated users, and discovers
your product's actions for you. Or connect the MCP server directly to your editor to browse
and implement AI Actions by hand.

## Set up with your AI coding tool

Once you have your Agent Key, skip the manual wiring and let your AI coding tool do the
integration:

<AiSetupCard />

## Add Foldspace to Claude in one click

Using Claude on the web or desktop? Add Foldspace as a custom connector. The link pre-fills
the name and URL, so all you do is confirm and authenticate:

[**Add the Foldspace connector to Claude →**](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Foldspace&connectorUrl=https%3A%2F%2Fapi.foldspace.ai%2Fmcp)

Connector URL: `https://api.foldspace.ai/mcp`

In **Claude Code**, add the same server from the terminal instead:

```bash
claude mcp add --transport http foldspace https://api.foldspace.ai/mcp
```

## Using the Foldspace Model Context Protocol (MCP) servers

The Model Context Protocol (MCP) is a standard for giving AI models real-time, external context. Foldspace exposes **two** MCP servers — add either or both to your editor:

| | Docs MCP | Product MCP |
|---|---|---|
| Endpoint | `https://docs.foldspace.ai/mcp` | `https://api.foldspace.ai/mcp` |
| Auth | **Public** (no key) | **OAuth** (sign in from your client) |
| Gives your assistant | Semantic search + read access to these docs (`search_docs`, `fetch_page`) | Access to your account's AI Actions: list them, read schemas, generate handlers |
| Best for | Any developer — ask questions about Foldspace while you code | Building on your own Foldspace agent |

Start with the **Docs MCP** — there's nothing to configure but a URL. Add the **Product MCP** when you want your assistant to work with your own AI Actions.

## Docs MCP server (public)

The Docs MCP is read-only and needs no API key. Point any MCP client at `https://docs.foldspace.ai/mcp`. It exposes two tools — `search_docs` (semantic search over the docs) and `fetch_page` (fetch a page as Markdown) — so you can ask your assistant things like *"how do I configure JWT auth in Foldspace?"* and it answers from the current docs.

**Claude Code**

```bash
claude mcp add --transport http foldspace-docs https://docs.foldspace.ai/mcp
```

**Cursor** — Settings → Tools & Integrations → New MCP Server:

```json
{
  "mcpServers": {
    "foldspace-docs": { "url": "https://docs.foldspace.ai/mcp" }
  }
}
```

**Windsurf** — Cascade → hammer icon → Configure → View raw config:

```json
{
  "mcpServers": {
    "foldspace-docs": { "serverUrl": "https://docs.foldspace.ai/mcp" }
  }
}
```

**VS Code (GitHub Copilot)** — in `.vscode/mcp.json`:

```json
{
  "servers": {
    "foldspace-docs": { "type": "http", "url": "https://docs.foldspace.ai/mcp" }
  }
}
```

## Product MCP server (your AI Actions)

The Product MCP exposes your Foldspace AI Actions as callable tools. Connecting your editor
to it lets your AI assistant:

- 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.

It's a hosted HTTP server at `https://api.foldspace.ai/mcp`. There's no API key to paste and
nothing to install. The first time your client connects, Foldspace opens a browser window
for you to sign in, and the client stores the resulting OAuth token itself.

### Claude

Use the one-click connector link above, or in Claude Code:

```bash
claude mcp add --transport http foldspace https://api.foldspace.ai/mcp
```

Then run `/mcp` and pick **foldspace** to complete the OAuth sign-in.

### Cursor

Settings → Tools & Integrations → New MCP Server:

```json
{
  "mcpServers": {
    "foldspace": { "url": "https://api.foldspace.ai/mcp" }
  }
}
```

Cursor prompts you to authenticate the first time it connects.

### Windsurf

Cascade → hammer icon → Configure → View raw config:

```json
{
  "mcpServers": {
    "foldspace": { "serverUrl": "https://api.foldspace.ai/mcp" }
  }
}
```

### Visual Studio Code (GitHub Copilot)

Open Settings, search for "MCP", and make sure **GitHub > Copilot > Chat: MCP** is enabled.
Then create `.vscode/mcp.json` at your workspace root:

```json
{
  "servers": {
    "foldspace": { "type": "http", "url": "https://api.foldspace.ai/mcp" }
  }
}
```

Reload the window, then use `#` in the Copilot Chat panel to reference the Foldspace tools.

## What you get after connecting

Once the connector is authorized, the Foldspace tools show up in your client. Here's how it
looks in Claude's connector settings:

<ConnectorScreen />

Tools are grouped by what they touch, so you can let read-only calls run freely and keep
approval on anything that writes.
