Switcher MCP server
2026년 11월 8일 커밋Switcher API의 feature flag 기능을 MCP tool로 노출하여 AI 어시스턴트가 도메인, 환경 목록을 조회하고 flag 설정을 가져올 수 있게 합니다.
다른 이름 switcherapi/switcher-mcp-server
- 스타
- 0
- Tools
- 3
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 8일
- 라이선스
- MIT
Switcher MCP란?
Switcher은(는) MCP server입니다. Switcher API의 feature flag 기능을 MCP tool로 노출하여 AI 어시스턴트가 도메인, 환경 목록을 조회하고 flag 설정을 가져올 수 있게 합니다. 3개 도구를 제공합니다. 예: list_domains, list_environments, get_feature_flag.
프로젝트 README에서 생성된 요약
Switcher MCP server 정보
이 server는 Claude Desktop, VS Code 또는 GitHub Copilot CLI를 사용하는 개발자가 AI 어시스턴트를 통해 feature flag 설정을 관리할 수 있도록 지원합니다. AI 클라이언트를 Switcher API에 연결하여 개발 환경을 벗어나지 않고도 도메인 정보, 환경 목록 및 특정 flag 설정을 조회할 수 있습니다. 이 server는 Switcher 인스턴스에서 실시간 데이터를 가져오기 위해 list_domains, list_environments, get_feature_flag와 같은 특화된 tool을 제공합니다.
보안은 OAuth 2.1 Authorization Code with PKCE flow를 통해 처리되므로 client secret이 저장되거나 공유되지 않습니다. stdio transport를 사용하는 로컬 subprocess로 실행하거나 streamable HTTP transport를 사용하는 원격 서비스로 실행할 수 있습니다. 로컬에서 실행할 경우, server는 브라우저를 열어 동의를 받고 제한된 로컬 파일에 자격 증명을 캐싱하여 인증을 관리합니다. 보안상의 이유로 이 server는 정보 조회용으로 설계되었으며 feature flag 토글은 지원하지 않습니다.
활용 사례
- 1접근 가능한 Switcher 도메인 확인AI 어시스턴트에게 현재 Switcher에서 소유하거나 협업 중인 모든 도메인을 식별하도록 요청합니다.
- 2도메인 환경 목록 조회특정 도메인 ID와 연결된 모든 사용 가능한 환경 목록을 요청합니다.
- 3특정 flag 설정 가져오기key와 environment name을 사용하여 feature flag의 정확한 구성 및 설정을 조회합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
Switcher MCP 도구 3
README에서 감지됨list_domainslist_environmentsget_feature_flag
| list_domains | — | |
| list_environments | — | |
| get_feature_flag | — |
구성
SWITCHER_API_CERT_PATHSWITCHER_API_URL
| 이름 | 설명 | 유형 |
|---|---|---|
| SWITCHER_API_CERT_PATH | — | |
| SWITCHER_API_URL | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능switcherapi/switcher-mcp-server is public and reachablegithub.com/switcherapi/switcher-mcp-server ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-08github.com/switcherapi/switcher-mcp-server ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음3 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기
About
Switcher MCP Server exposes Switcher API feature flags to MCP-capable AI assistants (Claude Desktop, VS Code, GitHub Copilot CLI, etc.) as a set of MCP tools. It authenticates on behalf of a real Switcher API user/admin using an OAuth 2.1 Authorization Code + PKCE flow with Dynamic Client Registration, so no client secret is ever stored or shared.
Toggling feature flags will not be supported by this MCP Server for security and consistency reasons.
Quick Start
Requirements
- Python 3.15+
- pipenv for dependency management
- A running switcher-api instance with OAuth enabled
- A switcher-management instance for the
browser-based consent screen (
/oauth/consent)
Authentication
How authentication works depends on the transport.
Streamable HTTP transport
The MCP client (VS Code, Claude, etc.) performs the OAuth flow itself, on the user's machine, when it registers/connects to the MCP server.
- The client calls
/mcpwithout a token and receives a401challenge whoseresource_metadatapoints to the server's protected-resource metadata. - The metadata advertises switcher-api as the authorization server. The client discovers its
OAuth metadata and dynamically registers via
POST /oauth/register(public, PKCE-only client). - The client opens the consent page in the user's browser (switcher-management's
/oauth/consent), which happens during MCP registration. - The client exchanges the code for tokens via
POST /oauth/tokenand sends the access token as a bearer token on every MCP request. The server forwards it to switcher-api, which validates it and its scopes.
If the token is rejected (e.g. consent revoked), tool calls fail with an error asking you to
re-authorize the MCP client. Set SWITCHER_MCP_PUBLIC_URL when the server is reachable through a
different URL than http://<host>:<port>.
Stdio transport
The server is a local subprocess of the client, so it runs the authorization flow itself. When a tool call needs a Switcher API token and none is cached (or the cached one can't be refreshed), it runs the browser-based flow before retrying the call — the browser is not opened eagerly on server startup. That flow:
- Discovers switcher-api's OAuth metadata from
GET {SWITCHER_API_URL}/.well-known/oauth-authorization-server. - Dynamically registers itself as an OAuth client via
POST /oauth/register(no client secret — a public, PKCE-only client) and persists the issuedclient_idlocally. - Opens your default browser (the server runs on your machine) to switcher-management's consent screen so you can log in (if needed) and approve access.
- Receives the authorization code on a local loopback callback (
http://127.0.0.1:<port>/callback) and exchanges it for an access/refresh token pair viaPOST /oauth/token.
In stdio mode, credentials (client id, tokens, expiry) are cached at ~/.switcher-mcp/credentials.json
(file permissions restricted to the current user on POSIX systems) and refreshed automatically
using the rotating refresh token. If the refresh token itself expires, the next tool call will
reopen the browser to re-authorize automatically; if you never complete the consent step, the
authorization attempt times out and the tool call fails with an error telling you to retry.
You can revoke access at any time from switcher-management's Settings → Authorized Apps page.
Running the Server
Configure the target switcher-api instance via the SWITCHER_API_URL environment variable or the
--api-url CLI flag (defaults to http://127.0.0.1:3000).
Stdio Transport
For the default stdio transport:
pipenv run python -m switcher_mcp_server.server --api-url https://switcherapi.com/api
Streamable HTTP Transport (embedded uvicorn - single worker)
For a hosted/remote MCP server:
pipenv run python -m switcher_mcp_server.server --transport streamable-http --host 0.0.0.0 --port 8000
The server will be reachable at http://<host>:<port>/mcp.
Streamable HTTP Transport (external uvicorn - multiple workers)
For containerized/production deployments that need custom TLS certificates
or multiple workers, run switcher_mcp_server.asgi:create_app with your own uvicorn process
instead (the --factory flag is required, since the app is built from a factory function):
pipenv run uvicorn switcher_mcp_server.asgi:create_app \
--factory \
--host 0.0.0.0 \
--port 8443 \
--ssl-certfile=/etc/certs/ca.crt \
--ssl-keyfile=/etc/certs/ca.key \
--workers 4
If the target switcher-api instance is also served under that certificate, set
SWITCHER_API_CERT_PATH to the same cert file so outbound requests verify against it instead of
the default CA bundle:
export SWITCHER_API_CERT_PATH=/etc/certs/ca.crt
Configuration
| Variable | CLI flag | Default | Description |
|---|---|---|---|
SWITCHER_API_URL |
--api-url |
http://127.0.0.1:3000 |
Base URL of the target switcher-api instance |
SWITCHER_API_INTERNAL_URL |
--api-internal-url |
unset (uses SWITCHER_API_URL) |
Internal switcher-api URL used only for server-side tool requests |
SWITCHER_API_CERT_PATH |
— | unset | Path to the TLS certificate for Switcher API |
SWITCHER_MCP_TRANSPORT |
--transport |
stdio |
stdio or streamable-http |
SWITCHER_MCP_HOST |
--host |
0.0.0.0 |
Bind host for the streamable HTTP transport |
SWITCHER_MCP_PORT |
--port |
8000 |
Bind port for the streamable HTTP transport |
SWITCHER_MCP_PUBLIC_URL |
--public-url |
http://<host>:<port> |
Externally reachable MCP URL used as the OAuth resource identifier (streamable HTTP only) |
SWITCHER_MCP_CREDENTIALS_PATH |
— | ~/.switcher-mcp/credentials.json |
Override the persisted OAuth credentials cache location |
CLI flags take precedence over environment variables.
Internal API URL (hosted deployments)
SWITCHER_API_URL is the public URL: it is used for OAuth issuer discovery, authorization,
token and refresh requests. Optionally, SWITCHER_API_INTERNAL_URL points MCP server-to-API tool
requests at an internal endpoint (e.g. a Kubernetes service), bypassing the public ingress. The
internal URL is never advertised to OAuth clients. When unset, tool requests use SWITCHER_API_URL.
env:
- name: SWITCHER_API_URL
value: https://switcherapi.com/api
- name: SWITCHER_API_INTERNAL_URL
value: http://switcher-api.switcherapi.svc.cluster.local:3000
MCP Client Configuration
Example stdio configuration for an MCP client (e.g. Claude Desktop, VS Code):
{
"mcpServers": {
"switcher": {
"command": "pipenv",
"args": ["run", "python", "-m", "switcher_mcp_server.server"],
"cwd": "/path/to/switcher-mcp-server",
"env": {
"SWITCHER_API_URL": "https://switcherapi.com/api"
}
}
}
}
Available Tools
| Tool | Description |
|---|---|
list_domains |
List the domains the authenticated user owns and/or collaborates on. |
list_environments |
List environment names for a given domain id. |
get_feature_flag |
Get a feature flag's settings by key, domain name, and optional environment. |
Available Prompts
Prompts are user-selectable, guided templates (e.g. shown as /switcher_domains in MCP clients)
that drive one of the tools above and ask the model to summarize or analyze its result. All
prompts are prefixed with switcher_ for easy discovery.
| Prompt | Drives | Description |
|---|---|---|
switcher_domains |
list_domains |
Discover and summarize the Switcher domains accessible to the authenticated user. |
switcher_environments |
list_environments |
List a Switcher domain's environments. |
switcher_get_feature |
get_feature_flag |
Fetch a Switcher feature flag's settings. |
Development
Quality Gate
make install # pipenv install --dev
make lint # pylint switcher_mcp_server
make test # pytest with coverage (coverage.xml)
make cover # generate an HTML coverage report (htmlcov/)
make e2e-tools # manual, configurable e2e tool validation (see scripts/e2e/README.md)
make e2e-prompts # manual, configurable e2e prompt validation (see scripts/e2e/README.md)
Both pylint and pytest must pass before merging changes. Tests use pytest-httpx to mock all
outbound HTTP calls to switcher-api — no live server is required to run the test suite.
Contributing
Read our Contributing guide to learn about our development process, and how to propose enhancements and improvements.
AI Disclaimer
This project was designed and implemented with AI-assisted tools. We have thoroughly reviewed and tested all AI-generated contributions to ensure they meet our quality standards and align with our project's goals. We are committed to transparency about our use of AI and will continue to disclose any significant AI contributions in the future.
External contributions from the community are equally valued and will be reviewed with the same standards, regardless of whether they were assisted by AI or not. We encourage all contributors to disclose their use of AI tools in their contributions to maintain transparency and foster trust within our community.
Switcher MCP 질문
Switcher MCP는 어떤 도구를 제공하나요?
3개 도구를 제공합니다. 예: list_domains, list_environments, get_feature_flag.
이 server를 사용하여 feature flag를 토글할 수 있나요?
보안 및 일관성을 위해 feature flag 토글 기능은 지원하지 않습니다.
server는 인증을 어떻게 처리하나요?
Dynamic Client Registration이 포함된 OAuth 2.1 Authorization Code + PKCE flow를 사용하여 client secret을 저장하거나 공유하지 않습니다.
stdio mode에서 자격 증명은 어디에 저장되나요?
client ID 및 token과 같은 자격 증명은 ~/.switcher-mcp/credentials.json에 로컬로 캐싱됩니다.