Detected country: US
logo
Open AppStatusSubmit Ticket
GuideAPI References
‌
‌
‌
logo

Powered by

  • Home
  • Advanced
  • MCP Server
  • Brainfish MCP Server

Brainfish MCP Server

14min read

Share

The Brainfish MCP (Model Context Protocol) Server connects AI assistants — Cursor, Claude Desktop, Claude.ai, VS Code Copilot, and any other MCP-compatible tool — directly to your Brainfish knowledge base. You can search, read, write, and manage documents and collections without leaving your AI assistant.

Hosted endpoint: https://mcp.brainfi.sh


Table of Contents

  1. Getting Started
  2. Credentials
  3. Authentication
  4. Setup by Platform
    • Claude.ai Web
    • Cursor
    • Claude Desktop
    • VS Code Copilot
  5. Tools Reference
    • Search & Documents
    • Suggestions
    • Collections
    • AI & Answers
    • Catalogs
    • Auth
  6. MCP Resources
  7. Example Prompts
  8. Error Reference
  9. Self-Hosting
  10. FAQ

Getting Started

The fastest way to connect is via Claude.ai (fully automated OAuth) or by pasting a config snippet into Cursor or Claude Desktop.

You need two things before you begin:

CredentialRequired for
API Token (bf_api_...)All tools
Agent Keybrainfish_generate_answer and brainfish_generate_follow_ups only

Credentials

API Token

  1. Open the Brainfish Dashboard
  2. Go to Settings → API Tokens
  3. Click Create token and copy the value — it starts with bf_api_

Agent Key

  1. Open the Brainfish Dashboard
  2. Go to Agents
  3. Click any agent to reveal and copy its key

The agent-key is only required for the two AI answer tools. All document, collection, and catalog tools work with the API token alone.


Authentication

The server supports two authentication methods depending on the client.

OAuth 2.1 — Claude.ai (automatic)

Claude.ai handles the full OAuth 2.1 + PKCE flow automatically. You enter your API token once in a browser window; Claude stores the resulting access token and reuses it on every call.

The server is fully stateless — credentials are encoded inside the token itself. No database or server-side secrets are involved.

EndpointURL
Discoveryhttps://mcp.brainfi.sh/.well-known/oauth-authorization-server
Authorizationhttps://mcp.brainfi.sh/authorize
Token Exchangehttps://mcp.brainfi.sh/token
Client Registrationhttps://mcp.brainfi.sh/register

Bearer Token — Cursor, Claude Desktop, VS Code

Pass your API token directly in the Authorization header on every request:

Authorization: Bearer bf_api_YOUR_TOKEN

agent-key: YOUR_AGENT_KEY

Alternatively you can use x-brainfish-api-key or x-api-key as the header name — these take priority over Authorization.


Setup by Platform

Claude.ai Web

  1. Go to claude.ai/settings/integrations
  2. Click Add custom connector
  3. Fill in:
    • Name: Brainfish
    • URL: https://mcp.brainfi.sh
  4. Click Add — a browser window opens
  5. Enter your bf_api_... API token (and optionally your Agent Key)
  6. Click Authorize

Claude stores the token and manages re-authentication automatically.


Cursor

Go to Settings → Features → MCP Servers → Add new global MCP server and paste:

{
  "mcpServers": {
    "brainfish": {
      "url": "https://mcp.brainfi.sh",
      "headers": {
        "Authorization": "Bearer bf_api_YOUR_TOKEN",
        "agent-key": "YOUR_AGENT_KEY"
      }
    }
  }
}

Replace bf_api_YOUR_TOKEN and YOUR_AGENT_KEY with your actual credentials.


Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "brainfish": {
      "url": "https://mcp.brainfi.sh",
      "headers": {
        "Authorization": "Bearer bf_api_YOUR_TOKEN",
        "agent-key": "YOUR_AGENT_KEY"
      }
    }
  }
}

Restart Claude Desktop after saving.


VS Code Copilot

Add to your User Settings (JSON) (Cmd+Shift+P → Open User Settings JSON):

{
  "mcp": {
    "servers": {
      "brainfish": {
        "type": "http",
        "url": "https://mcp.brainfi.sh",
        "headers": {
          "Authorization": "Bearer bf_api_YOUR_TOKEN",
          "agent-key": "YOUR_AGENT_KEY"
        }
      }
    }
  }
}

Tools Reference

Search & Documents

brainfish_search_documents

Semantic search across your Brainfish knowledge base.

ParameterTypeRequiredDefaultDescription
querystring✅—Search query (1–2000 characters)
collectionIdUUID——Restrict search to a single collection
collectionIdsUUID[]——Restrict search to multiple collections
dateFilterenum——day, week, month, or year
limitnumber—10Results to return (1–25)
cmsOnlyboolean—falseOnly search CMS-sourced content

Example prompt:

"Search Brainfish for articles about password reset"


brainfish_get_document

Retrieve a specific document's full content.

ParameterTypeRequiredDescription
idstring✅Document UUID or URL slug

Example prompt:

"Get the Brainfish document with ID abc-123"


brainfish_list_documents

List documents with filtering and pagination.

ParameterTypeRequiredDefaultDescription
collectionIdUUID——Filter by collection
sortenum—updatedAtcreatedAt, updatedAt, publishedAt, title
directionenum—DESCASC or DESC
limitnumber—25Results per page (1–100)
offsetnumber—0Pagination offset

Example prompt:

"List all documents in my Help Center collection, sorted by title"


brainfish_create_document

Create a new document in a collection.

ParameterTypeRequiredDefaultDescription
collectionIdUUID✅—Collection to create the document in
titlestring—""Document title
textstring—""Document content in Markdown
parentDocumentIdUUID——Create as a child document
publishboolean—falsePublish immediately
templateboolean—falseMark as a template
templateIdUUID——Base on an existing template

Example prompt:

"Create a new published document titled 'Webhook Setup Guide' in the Help Center collection"


brainfish_update_document

Update an existing document's title, content, or settings.

ParameterTypeRequiredDescription
idstring✅Document UUID or URL slug
titlestring—New title
textstring—New content in Markdown
publishboolean—Publish or unpublish
fullWidthboolean—Enable full-width display
collectionIdUUID—Move to a different collection
siteEnabledboolean—Make publicly visible on site

Example prompt:

"Update the OAuth guide document to add a section on PKCE and publish it"


brainfish_delete_document

Delete a document. Soft-deletes by default; use permanent: true to remove it entirely.

ParameterTypeRequiredDefaultDescription
idstring✅—Document UUID or URL slug
permanentboolean—falsePermanently delete (cannot be undone)

Warning: permanent: true is irreversible.


Suggestions

Suggestions enter a review queue rather than modifying documents directly, making them safe to use with AI assistants.

brainfish_suggest_document_changes

Propose edits to an existing document.

ParameterTypeRequiredDefaultDescription
documentIdstring✅—Target document UUID or slug
textstring✅—Suggested document content in Markdown
titlestring——Suggested new title
reasonstring—""Reason for the change
sourcestring—mcp_clientSource identifier
sourceIdstring——External reference ID

Example prompt:

"Suggest updating the API authentication guide with the new token format"


brainfish_suggest_new_document

Suggest creating a brand-new document (routed through the suggestion system).

ParameterTypeRequiredDefaultDescription
baseDocumentIdstring✅—Existing document to anchor the suggestion to
titlestring✅—Title for the new document
textstring✅—Content in Markdown
reasonstring—Auto-generatedReason for creating this document
sourcestring—mcp_clientSource identifier
collectionIdstring——Target collection for the new document

brainfish_update_suggestion

Edit a pending suggestion before it is reviewed.

ParameterTypeRequiredDescription
suggestionIdUUID✅Suggestion UUID
titlestring—Updated title
textstring—Updated content
reasonstring—Updated reason

brainfish_generate_article_suggestion

Trigger the Brainfish Knowledge Discovery Agent to analyse content and generate article suggestions asynchronously. Returns a task_id you can use to track progress.

ParameterTypeRequiredDefaultDescription
contentstring✅—Content to analyse (Markdown)
collection_idUUID——Target collection for new article drafts
new_articleboolean—falsetrue = create new drafts; false = suggest updates to existing docs

Note: Results are cached for 5 minutes. A duplicate request within that window returns a 409 conflict.


Collections

brainfish_list_collections

List all collections your token can access.

ParameterTypeRequiredDefaultDescription
sortByenum—updatedAtupdatedAt, index, or name
directionenum—DESCASC or DESC
limitnumber—25Results per page (1–100)
offsetnumber—0Pagination offset

brainfish_get_collection

Get details of a specific collection.

ParameterTypeRequiredDescription
idstring✅Collection ID

brainfish_create_collection

Create a new collection to organise documents.

ParameterTypeRequiredDescription
namestring✅Collection name
descriptionstring—Description
iconstring—Emoji or icon name
colorstring—Hex colour (e.g. #FF5733)
permissionenum—read or read_write
sharingboolean—Enable sharing
siteEnabledboolean—Make publicly visible on site

brainfish_update_collection

Update an existing collection's properties.

ParameterTypeRequiredDescription
idstring✅Collection ID
namestring—New name
descriptionstring—New description
iconstring—New icon
colorstring—New hex colour
permissionenum—read or read_write
sharingboolean—Toggle sharing
siteEnabledboolean—Toggle public visibility

brainfish_delete_collection

Delete a collection and all documents within it.

ParameterTypeRequiredDescription
idstring✅Collection ID

Warning: This is irreversible. You cannot delete the last collection in a team.


AI & Answers

These two tools require the agent-key header in addition to your API token.

brainfish_generate_answer

Generate a streaming AI answer sourced from your knowledge base.

ParameterTypeRequiredDescription
querystring✅Question to answer (1–2000 characters)
conversationIdstring—Continue an existing conversation (25-char ID)

Example prompt:

"Use Brainfish to answer: what is the rate limit for the API?"


brainfish_generate_follow_ups

Generate suggested follow-up questions based on a completed AI conversation.

ParameterTypeRequiredDefaultDescription
conversationIdstring✅—Conversation ID from a previous generate_answer call
limitnumber—3Number of follow-ups to return (1–10)

Catalogs

Catalogs let you sync external content (websites, CMS platforms, Zendesk, Notion, etc.) into Brainfish for search and AI answers.

brainfish_list_catalogs

List all catalogs for your team.

ParameterTypeRequiredDefaultDescription
sourceenum——Filter by source: cms, website, zendesk, github, notion, confluence, intercom, freshdesk, helpscout, readme, readmev2, oas, helpjuice, googledrive, guru, discovery, external
statusenum——Filter by sync status: inprogress, completed, failed
limitnumber—25Results per page (1–100)
offsetnumber—0Pagination offset

brainfish_get_catalog

Get a catalog by ID, including its content count.

ParameterTypeRequiredDescription
idUUID✅Catalog UUID

brainfish_create_catalog

Create a new catalog. After creation, use brainfish_sync_catalog_content to push content into it.

ParameterTypeRequiredDescription
namestring✅Catalog name (max 255 chars)
sourceenum✅Source type (same enum as list_catalogs)
slugstring—Unique slug (max 100 chars)
configurationsobject—Source-specific configuration options

brainfish_sync_catalog_content

Full-sync an array of content files to a catalog. Files not included in the request are removed from the catalog.

ParameterTypeRequiredDescription
idUUID✅Catalog UUID
filesarray✅Array of content file objects (see below)

Each item in files:

FieldTypeRequiredDescription
urlstring✅Unique identifier / URL for this file within the catalog
contentstring✅File content (Markdown or plain text)
titlestring✅Content title

Note: This is a full replace. Any file present in the catalog but absent from this request will be deleted.


Auth

brainfish_validate_token

Validate your API token and retrieve the associated user and team information.

No parameters required.

Example prompt:

"Validate my Brainfish token and show me my account info"


MCP Resources

Resources expose read-only content via brainfish:// URIs. MCP-compatible clients can reference them directly.

URIMIME TypeDescription
brainfish://collectionsapplication/jsonAll accessible collections
brainfish://collection/{id}application/jsonCollection details and metadata
brainfish://collection/{id}/documentsapplication/jsonDocuments within a collection
brainfish://document/{id}text/markdownFull document content
brainfish://search?query={q}application/jsonSemantic search results

Example Prompts

Search & Read

"Use Brainfish to answer: how do I reset my password?"
"Search Brainfish for our API authentication guide"
"List all collections in my Brainfish workspace"
"Show me the documents in the Help Center collection"

Create & Update Content

"Create a new document in the Help Center collection about webhook setup"
"Update the OAuth guide to add a section on refresh tokens and publish it"
"Search Brainfish for our API authentication guide and update it with the new OAuth steps"

Suggestions (safe for AI assistants)

"Suggest improvements to the onboarding document based on these support tickets"
"Generate article suggestions from this conversation transcript and add them to the Help Center collection"

Catalogs

"Sync these 5 markdown files to my CMS catalog"
"Show me which catalogs have failed their last sync"

Error Reference

HTTP CodeError CodeMeaningWhat to do
401authentication_requiredMissing or invalid API tokenCheck your Authorization header value
403forbiddenToken lacks permission for this resourceVerify the token has the right workspace access
404not_foundDocument, collection, or catalog does not existCheck the ID/slug is correct
409conflictDuplicate request (article suggestions are cached for 5 min)Wait 5 minutes before re-submitting
422validation_failedInvalid request parametersCheck required fields and value formats
429rate_limit_exceeded25 requests/min limit reachedBack off and retry after a short wait
500internal_errorBrainfish server errorRetry; contact support with the requestId

Every error response includes a requestId field. Share it with Brainfish support for faster debugging.


Self-Hosting

The server is a standard Next.js application you can deploy to Vercel with a single click — no environment variables required.

Deploy with Vercel

Optional environment variables:

VariableDefaultPurpose
BRAINFISH_API_URLhttps://api.brainfi.shOverride the upstream Brainfish API base URL
BRAINFISH_TIMEOUT30000HTTP timeout in milliseconds
BRAINFISH_RETRY_ATTEMPTS3Retry count on 429 / 5xx responses
BRAINFISH_RETRY_DELAY1000Base retry delay in milliseconds (exponential backoff applied)

FAQ

Do I need an agent-key for all tools? No. The agent key is only required for brainfish_generate_answer and brainfish_generate_follow_ups. All document, collection, catalog, and suggestion tools work with just the API token.

Is my API token stored on the server? No. The server is fully stateless. Your credentials are encoded within the OAuth access token itself and are never persisted server-side.

What happens if I call brainfish_sync_catalog_content with a partial file list? Files present in the catalog but absent from the request are permanently removed. Always include the complete set of files you want to keep.

Can I use a URL slug instead of a UUID for documents? Yes. The brainfish_get_document, brainfish_update_document, and brainfish_delete_document tools accept either a UUID or a URL slug in the id parameter.

What Markdown flavour should I use for document content? Standard CommonMark Markdown is supported for the text field in create/update operations.

Where do I find the conversationId for follow-up questions? It is returned in the response from brainfish_generate_answer. Pass it to brainfish_generate_follow_ups to get related questions.


Support

  • Help Center: help.brainfi.sh
  • API Reference: help.brainfi.sh/articles/api-reference-7mjzVCAmeM
  • GitHub Issues: github.com/brainfish-ai/brainfish-mcp-server/issues
  • Dashboard: app.brainfi.sh

Share