Skip to content

featbit/featbit-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FeatBit MCP Server

IMPORTANT NOTE:

We're moving our MCP server into FeatBit's main project, and MCP tools will be exposed through the FeatBit API service.E


A Model Context Protocol (MCP) server that lets AI coding agents manage FeatBit feature flags through natural language. It acts as a thin proxy — your FeatBit API credentials are forwarded with each request, so the hosted server never stores them.

Built with .NET 10, ASP.NET Core, and Aspire.


Integration

The FeatBit MCP server is publicly hosted at https://mcp.featbit.co/mcp.

Where to find these values:

  • API Key: FeatBit console → Organization Settings → API Keys → Generate New Key
  • Organization ID: FeatBit console → Organization Settings → General → Organization ID

Set FeatBit credentials as MCP request headers. Authorization is forwarded as-is to the FeatBit API, so use the same access token or personal token value you would use when calling the API directly. Organization should be set when your FeatBit token or deployment requires an organization context. Workspace is also forwarded when provided. Do not pass credentials as MCP tool parameters.


Remote (Hosted)

Connect to the hosted server — no installation or build required.

VS Code / GitHub Copilot

Add or update .vscode/mcp.json in your workspace:

{
  "servers": {
    "featbit": {
      "type": "http",
      "url": "https://mcp.featbit.co/mcp",
      "headers": {
        "Authorization": "${input:featbitApiKey}",
        "Organization": "${input:featbitOrgId}"
      }
    }
  },
  "inputs": [
    {
      "id": "featbitApiKey",
      "type": "promptString",
      "description": "FeatBit API Key",
      "password": true
    },
    {
      "id": "featbitOrgId",
      "type": "promptString",
      "description": "FeatBit Organization ID"
    }
  ]
}

VS Code MCP Guide

Claude Code

Add to your project .mcp.json or run:

claude mcp add --transport http featbit https://mcp.featbit.co/mcp

To include your API key, edit .mcp.json:

{
  "mcpServers": {
    "featbit": {
      "type": "http",
      "url": "https://mcp.featbit.co/mcp",
      "headers": {
        "Authorization": "YOUR_FEATBIT_API_KEY",
        "Organization": "YOUR_ORGANIZATION_ID"
      }
    }
  }
}

Claude Code MCP Guide

Cursor

Add to ~/.cursor/mcp.json (macOS/Linux) or %USERPROFILE%\.cursor\mcp.json (Windows):

{
  "mcpServers": {
    "featbit": {
      "url": "https://mcp.featbit.co/mcp",
      "headers": {
        "Authorization": "YOUR_FEATBIT_API_KEY",
        "Organization": "YOUR_ORGANIZATION_ID"
      }
    }
  }
}

Cursor MCP Guide

Codex CLI

Add via CLI:

codex mcp add featbit --url "https://mcp.featbit.co/mcp"

Or add to ~/.codex/mcp_servers.json:

{
  "featbit": {
    "url": "https://mcp.featbit.co/mcp",
    "headers": {
      "Authorization": "YOUR_FEATBIT_API_KEY",
      "Organization": "YOUR_ORGANIZATION_ID"
    }
  }
}

Codex MCP Guide


Local (Self-Hosted)

Run the server from source when you need a custom BaseUrl pointing to a self-hosted FeatBit instance, or when you want to extend the server with your own tools.

Prerequisites

Setup

  1. Clone the repo:

    git clone https://github.com/featbit/featbit-mcp.git
    cd featbit-mcp
  2. Set the FeatBit API base URL in FeatBit/FeatBit.McpServer/appsettings.Development.json:

    {
      "FeatBitApi": {
        "BaseUrl": "https://app-api.featbit.co"
      }
    }

    Change BaseUrl to your self-hosted instance URL if needed.

  3. Run the server:

    # With Aspire (recommended — includes observability dashboard)
    dotnet run --project FeatBit/FeatBit.AppHost
    
    # Or run the MCP server directly
    dotnet run --project FeatBit/FeatBit.McpServer

    The server starts on http://localhost:5180.

Connect AI Clients to Local Server

VS Code / GitHub Copilot (.vscode/mcp.json):

{
  "servers": {
    "featbit-local": {
      "type": "http",
      "url": "http://localhost:5180/mcp",
      "headers": {
        "Authorization": "YOUR_FEATBIT_API_KEY",
        "Organization": "YOUR_ORGANIZATION_ID"
      }
    }
  }
}

Claude Code (.mcp.json):

{
  "mcpServers": {
    "featbit-local": {
      "type": "http",
      "url": "http://localhost:5180/mcp",
      "headers": {
        "Authorization": "YOUR_FEATBIT_API_KEY",
        "Organization": "YOUR_ORGANIZATION_ID"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "featbit-local": {
      "url": "http://localhost:5180/mcp",
      "headers": {
        "Authorization": "YOUR_FEATBIT_API_KEY",
        "Organization": "YOUR_ORGANIZATION_ID"
      }
    }
  }
}

Available Tools

Tool Description Parameters
GetProjects List all projects in the organization
GetProject Get a project's details, environments, and credentials (Server Key, Client Key) projectId
GetProjectFeatureFlags List feature flags across all environments in a project. Supports filtering by name/key, tags, and all-page fetching projectId (required), name, tags, pageIndex, pageSize, fetchAll
GetFeatureFlags List feature flags in an environment. Supports filtering by name/key, tags, enabled/disabled status, archived status, pagination, and all-page fetching envId (required), name, tags, isEnabled, isArchived, sortBy, pageIndex, pageSize, fetchAll
GetFeatureFlag Get a single feature flag by key envId (required), key (required)
ToggleFeatureFlag Enable or disable a feature flag envId (required), key (required), status (required)
ArchiveFeatureFlag Archive a feature flag. Archived flags are hidden from the main list by default but can be restored later envId (required), key (required)
CreateFeatureFlag Create a disabled boolean feature flag with default True / False variations envId (required), name (required), key (required), description, tags
UpdateFeatureFlagRollout Update the default rollout (fallthrough) of a feature flag. Only the /fallthrough path is modified — other flag settings are left unchanged. Accepts rollout assignments as [{"variationId", "percentage"}] where percentages must sum to 100 envId (required), key (required), rolloutAssignments (required), dispatchKey
GetAuditLogs List audit logs in an environment with keyword, creator, resource, time range, cross-environment, pagination, and all-page filters envId (required), query, creatorId, refId, refType, from, to, crossEnvironment, pageIndex, pageSize, fetchAll
GetFeatureFlagAuditLogs List audit logs for a feature flag. Accepts either flagId or flagKey; resolves flagKey to the flag ID automatically envId (required), flagId, flagKey, query, creatorId, from, to, crossEnvironment, pageIndex, pageSize, fetchAll
EvaluateFeatureFlags Evaluate feature flags for a given end user and return the variation served to that user. Set the X-FeatBit-Env-Secret request header to the environment secret key userKeyId (required), userName, customProperties, flagKeys, tags, tagFilterMode

Guidance for Coding Agents

When a user asks about feature flags but does not provide environment IDs, first call GetProjects, identify or ask for the intended project, then call GetProjectFeatureFlags with fetchAll: true.

For example, for a request like:

Please check which feature flags in the current project with tag xxx have reached their deletion date.

Use this flow:

  1. Call GetProjects if the project ID is not known.
  2. Call GetProjectFeatureFlags with projectId, tags: "xxx", and fetchAll: true.
  3. Inspect returned flag metadata such as key, name, description, tags, createdAt, updatedAt, and lastChange.
  4. If the deletion date is encoded in a tag or description, compare it with today's date and report matching flags.
  5. If change history is needed, call GetFeatureFlagAuditLogs with the environment ID and flagKey.
  6. Do not archive or toggle flags unless the user explicitly asks for that action.

https://app-api.featbit.co/docs/index.html https://app-api.featbit.co/swagger/OpenApi/swagger.json


Additional Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages