loading…
Search for a command to run...
loading…
Remote MCP server enabling AI clients to securely inspect repositories over SSH with read-only tools.
Remote MCP server enabling AI clients to securely inspect repositories over SSH with read-only tools.
AI-guided repository exploration over SSH via MCP
CodeSherpa is a remote MCP server that lets AI clients inspect repositories over SSH with a strict read-only toolset.
Supported MCP tools:
healthcheck_remotelist_filesread_filesearch_codegit_statusgit_diffgit_logCompatible MCP clients:
Clone and start CodeSherpa locally.
git clone https://github.com/boridon/code-sherpa.git
cd code-sherpa
cp .env.example .env
docker compose up -d
Then connect your MCP client to:
https://your-domain.example/mcp
MCP Client
|
v
CodeSherpa (HTTPS)
|
v
SSH (read-only user)
|
v
Private repository host
Key points:
.git, .env, node_modules, and similar sensitive paths... traversal are rejected./mcp requires mcp:read scope for OAuth access tokens.Note: OAuth sessions, authorization codes, and tokens are in-memory in the current implementation. They are reset when the container restarts.
git clone https://github.com/boridon/code-sherpa.git
cd code-sherpa
cp .env.example .env
mkdir -p secrets
secrets/id_ed25519ssh-keyscan -H <ssh-host> > secrets/known_hosts
chmod 600 secrets/id_ed25519
chmod 644 secrets/known_hosts
docker compose build
docker compose up -d
docker compose ps
curl http://127.0.0.1:8787/health
You can run CodeSherpa with Cloudflare in two ways.
docker compose -f docker-compose.yml -f docker-compose.cloudflare.yml up -d
This mode uses CLOUDFLARE_TUNNEL_TOKEN from .env.
cloudflared-config.yml)Example ingress:
ingress:
- hostname: code-sherpa.example.com
service: http://localhost:8787
- service: http_status:404
If cloudflared is not installed on your host:
sudo apt-get install cloudflaredsudo dnf install cloudflaredbrew install cloudflaredCodeSherpa includes a minimal built-in OAuth authorization server for connector setup flows.
OAuth discovery endpoints:
GET /.well-known/oauth-authorization-serverGET /.well-known/openid-configurationOAuth endpoints:
GET /authorizePOST /tokenGET /loginPOST /loginGET /oauth/consentPOST /oauth/consentOAuth profile:
S256)mcp:readtoken_endpoint_auth_method=none allowed)Use example values like these:
https://code-sherpa.example.com/mcphttps://code-sherpa.example.comhttps://code-sherpa.example.com/authorizehttps://code-sherpa.example.com/tokenmcp:readUse .env.example as the baseline.
Required:
SSH_HOSTSSH_PORTSSH_USERNAMEREPO_ROOTMCP_BEARER_TOKEN (for optional legacy/manual testing)OAUTH_ISSUER_BASE_URLOAUTH_LOGIN_USERNAMEOAUTH_LOGIN_PASSWORDOAUTH_SESSION_SECRETOptional/common:
PORT (default 8787)MCP_SERVER_NAME (default code-sherpa)MCP_SERVER_VERSION (default 0.1.0)OAUTH_COOKIE_SECURE (default true)MAX_FILE_BYTES, MAX_SEARCH_RESULTS, MAX_LOG_COMMITS, MAX_RESPONSE_CHARSExample .env snippet (safe placeholders):
PORT=8787
MCP_SERVER_NAME=code-sherpa
SSH_HOST=ssh-host.example.internal
SSH_PORT=22
SSH_USERNAME=repo_reader
REPO_ROOT=/srv/repos/project
OAUTH_ISSUER_BASE_URL=https://code-sherpa.example.com
OAUTH_LOGIN_USERNAME=replace-me
OAUTH_LOGIN_PASSWORD=replace-me
OAUTH_SESSION_SECRET=replace-with-long-random-secret
MCP_BEARER_TOKEN=replace-with-long-random-token
curl -i http://127.0.0.1:8787/.well-known/oauth-authorization-server
curl -i http://127.0.0.1:8787/.well-known/openid-configuration
curl -i -X POST http://127.0.0.1:8787/mcp \
-H "Authorization: Bearer ${MCP_BEARER_TOKEN}" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"0.0.1"}}}'
After browser login + consent, exchange the authorization code:
curl -i -X POST http://127.0.0.1:8787/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=<authorization-code>' \
--data-urlencode 'redirect_uri=<same-redirect-uri-used-at-authorize>' \
--data-urlencode 'code_verifier=<pkce-code-verifier>' \
--data-urlencode 'client_id=<client-id>'
code-sherpa
├── src/
│ ├── index.ts
│ ├── oauth.ts
│ ├── pkce.ts
│ ├── session.ts
│ └── token-store.ts
├── docs/
│ └── logo.svg
├── Dockerfile
├── docker-compose.yml
├── docker-compose.cloudflare.yml
├── cloudflared-config.example.yml
├── cloudflared-config.yml
├── .env.example
├── .gitignore
├── LICENSE
└── README.md
MIT
Issues and pull requests are welcome.
If CodeSherpa is useful to you, consider giving the repository a star on GitHub.
Выполни в терминале:
claude mcp add codesherpa -- npx Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolProvides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai