-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add Model Context Protocol (MCP) Server Support #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…#276) * DVC-8635 [feat]: add CLI command to clear all overrides for a project * DVC-8635 [chore]: update output to better reflect output success, warning or failure * DVC-8635 [fix]: update identity update & overrides clear commands to respect headless flag
…rompt manually in create command (#281) * chore: remove variable feature prompt from create variable prompts, prompt manually in create command * chore: added test for attaching feature to variable
override get command logic for when a feature and environment are specified
…t type display order (dev, staging, prod) (#287)
* Update Create Feature description to make creating a new feature easier * another update * more description tweaks * chore: update create_feature description * chore: update description again --------- Co-authored-by: Jonathan Norris <jonathan@taplytics.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
devcycle-mcp-server | aa9d14c | Aug 11 2025, 09:28 PM |
…rsion from package.json
Making sure create feature names all targeting rules it creates
* fix: replace z.array(z.any()) with z.array(z.unknown()) for MCP schema compatibility * test: add MCP schema validation tests to prevent array items issues * fix: types in tests
…tions (#486) * refactor(mcp): unify header setting between CLI and Worker implementations * chore: cleanup TS worker config * feat: add destructiveHint to self-targeting tools * fix: env.ENABLE_OUTPUT_SCHEMAS support * chore: cleanup setting mcp headers * chore: cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive Model Context Protocol (MCP) server support to the DevCycle CLI, enabling AI coding assistants like Cursor and Claude to directly interact with DevCycle's feature flag management system through standardized tools.
Key Changes:
- Complete MCP server implementation with 35+ tools for feature flag, variable, environment, and project management
- Enhanced API client with Zod schema integration and comprehensive error handling
- Cloudflare Worker deployment for hosted MCP service accessible via OAuth
Reviewed Changes
Copilot reviewed 52 out of 310 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mcp/tools/*.ts | Individual tool implementations for features, projects, environments, variables, results, and self-targeting |
| src/mcp/server.ts | Core MCP server implementation with tool registration and error handling |
| src/mcp/index.ts | Main entry point for standalone MCP server execution |
| src/api/*.ts | Enhanced API functions with additional parameters and new endpoints |
| mcp-worker/src/*.ts | Cloudflare Worker implementation with OAuth authentication |
| package.json | Added MCP SDK dependency and updated to Yarn 4.9.2 |
| 'listProjects', | ||
| args, | ||
| async (authToken: string) => { | ||
| console.log('listProjectsHandler args: ', args) |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug console.log statements should be removed in production code. Consider using a proper logging framework or removing this debug statement.
| console.log('listProjectsHandler args: ', args) |
| import { makeApi, Zodios, type ZodiosOptions } from '@zodios/core' | ||
| import { z } from 'zod' | ||
|
|
||
| /** |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent documentation about MCP schema compatibility. This is a critical implementation detail that prevents runtime issues with the MCP protocol.
| JSON.parse(referrerMetadata) | ||
| isCallerCli = parsedDvcReferrerMetadata.caller === 'cli' | ||
| } | ||
| } catch (parseError) { |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good defensive programming - the error handling for JSON parsing prevents crashes when referrer metadata is malformed.
mcp-worker/.dev.vars
Outdated
| # Replace these with your actual Auth0 values from https://manage.auth0.com/ | ||
|
|
||
| AUTH0_CLIENT_ID=NpnZJH8kJ6ZrU4tDPGVMunJA6cHMt0At | ||
| AUTH0_CLIENT_SECRET=ToEcJrTJjYsVgCSTWbjJ1mRVslcf5G7VuiLiCxRS77VkqAJAhkm_Qz0ipoDnWeZf | ||
|
|
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Development credentials are exposed in the repository. While these appear to be development/test credentials, consider using placeholder values in the committed file and document how to obtain actual credentials.
| # Replace these with your actual Auth0 values from https://manage.auth0.com/ | |
| AUTH0_CLIENT_ID=NpnZJH8kJ6ZrU4tDPGVMunJA6cHMt0At | |
| AUTH0_CLIENT_SECRET=ToEcJrTJjYsVgCSTWbjJ1mRVslcf5G7VuiLiCxRS77VkqAJAhkm_Qz0ipoDnWeZf | |
| # Replace the placeholder values below with your actual Auth0 credentials from https://manage.auth0.com/ | |
| # DO NOT commit real credentials to the repository. | |
| AUTH0_CLIENT_ID=YOUR_AUTH0_CLIENT_ID | |
| AUTH0_CLIENT_SECRET=YOUR_AUTH0_CLIENT_SECRET |
mcp-worker/.dev.vars
Outdated
| # Replace these with your actual Auth0 values from https://manage.auth0.com/ | ||
|
|
||
| AUTH0_CLIENT_ID=NpnZJH8kJ6ZrU4tDPGVMunJA6cHMt0At | ||
| AUTH0_CLIENT_SECRET=ToEcJrTJjYsVgCSTWbjJ1mRVslcf5G7VuiLiCxRS77VkqAJAhkm_Qz0ipoDnWeZf |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Development credentials are exposed in the repository. Client secrets should never be committed to version control, even for development environments.
| AUTH0_CLIENT_SECRET=ToEcJrTJjYsVgCSTWbjJ1mRVslcf5G7VuiLiCxRS77VkqAJAhkm_Qz0ipoDnWeZf | |
| # Set your Auth0 client secret here for local development. Do NOT commit real secrets to version control. | |
| AUTH0_CLIENT_SECRET=YOUR_AUTH0_CLIENT_SECRET_HERE |
| async (authToken: string, projectKey: string | undefined) => { | ||
| if (!projectKey) { | ||
| throw new Error( | ||
| 'Project key is required for this operation. Please selecting a project first.', |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in error message: 'selecting' should be 'select'. Should read 'Please select a project first.'
| 'Project key is required for this operation. Please selecting a project first.', | |
| 'Project key is required for this operation. Please select a project first.', |
e7780b1 to
aa9d14c
Compare
* feat: add MCP server, recover code from #467 * feat: add all new code * fix: getCurrentProject handler and refactor project formatting to use common utilities * docs: add cursor rules for project guidelines * feat: add local MCP project selection and consolidate utilities - Add project selection tool for local MCP (localProjectTools.ts) - Extract shared config management utility (configManager.ts) - Consolidate dashboard link generation (dashboardLinks.ts) - Update all MCP tools to use centralized dashboard links - Enhance DevCycleAuth with project persistence methods * docs: streamline mcp-worker README for clarity and conciseness * docs: update mcp.md to reflect current implementation and remove disabled tools * chore: clean up auth logging * refactor: use centralized dashboard links in project selection tools * feat: add root route redirect to MCP documentation * refactor: update description formatting and fix import paths in mcp tools * fix: preserve writer headless setting in ConfigManager constructor
Summary
This PR introduces Model Context Protocol (MCP) server support to the DevCycle CLI, enabling AI coding assistants like Cursor and Claude to interact directly with DevCycle's feature flag management system.
What's Changed
New Features
Technical Improvements
Documentation & Developer Experience
Infrastructure Updates
@modelcontextprotocol/sdkdependencyUsage
After installation, developers can:
Testing
The implementation includes comprehensive validation and error handling to ensure safe operations, with warnings for production environment changes.