1 # The official siGit MCP server
2
3 siGit Code Cloud runs a hosted [Model Context Protocol](https://modelcontextprotocol.io)
4 server at **`https://sigit.si/api/v1/mcp`**. It's a stateless **Streamable-HTTP**
5 server (JSON-RPC 2.0 over a single POST endpoint) that exposes your
6 siGit-hosted git repositories — plus web search — as MCP tools, so any MCP
7 client can browse repos, read files, search code, and open or comment on pull
8 requests and issues on your behalf.
9
10 This page documents the server from a **client's** perspective: the siGit Code
11 CLI is its reference consumer, but the endpoint is a standard remote MCP server
12 that works with any compliant client. The server implementation itself is
13 closed-source (it's part of the hosted service); only this consumer-facing
14 description is public.
15
16 ## Tools
17
18 | Tool | What it does |
19 | --- | --- |
20 | `list_repositories` | List the git repositories the authenticated user can access. Use this first to discover the `owner/name` to pass to other tools. |
21 | `get_file_contents` | Read a file's contents at a given ref (branch, tag, or commit SHA). |
22 | `search_code` | Search file contents across a repository; returns matching files with line snippets. |
23 | `list_issues` | List issues in a repository, optionally filtered by state or a title/body search. |
24 | `get_issue` | Fetch one issue by number, including its body and comments. |
25 | `create_issue` | Open a new issue in a repository. |
26 | `list_pull_requests` | List pull requests in a repository, optionally filtered by state. |
27 | `get_pull_request` | Fetch one pull request by number. |
28 | `create_pull_request` | Open a pull request from a head branch into a base branch. |
29 | `add_issue_comment` | Post a comment on an issue or pull request by its number. |
30 | `web_search` | Search the public web; returns matching pages as title, URL, and snippet. |
31
32 All repository tools take a repo in `owner/name` form and only ever see
33 repositories the authenticated user may access.
34
35 ## Authentication
36
37 The server is a per-user protected resource. Every `tools/call` requires an
38 `Authorization: Bearer <token>` header carrying a siGit Code Cloud session
39 token. Unauthenticated requests get a `401` with a `WWW-Authenticate` header
40 advertising the OAuth protected-resource metadata, so MCP clients that support
41 OAuth can discover the sign-in flow automatically.
42
43 Being stateless, the server issues no `Mcp-Session-Id` and offers no
44 server→client SSE stream (a `GET` to the endpoint returns `405`) — a valid,
45 tool-only MCP transport mode.
46
47 ## How the siGit Code CLI uses it
48
49 The CLI bakes this endpoint in as its **official** MCP server (default
50 `https://sigit.si/api/v1/mcp`, overridable via `SIGIT_CLOUD_URL`). When you're
51 signed in with `sigit login`, the CLI sends your cloud session token as the
52 bearer credential; when you're not, the server simply contributes no tools.
53 Its tools are namespaced `mcp__sigit__<tool>` inside the agent (see
54 [`src/mcp.rs`](../src/mcp.rs)). `web_search` is additionally re-exposed as a
55 first-class read-only tool rather than a raw `mcp__*` call.
56
57 A user-defined `mcp.toml` entry named `sigit` overrides the baked-in default,
58 so you can repoint the CLI at a different deployment without a code change.
59
60 ## MCP Registry listing
61
62 The server is published to the
63 [official MCP Registry](https://registry.modelcontextprotocol.io) as
64 **`si.sigit/sigit`**, a remote Streamable-HTTP listing, so registry-aware
65 clients can add it in one click. The registry only stores metadata; the
66 `server.json` and publish workflow live in the
67 [`getsigit/si`](https://github.com/getsigit/si) repo (the `si` CLI, also an
68 MCP client of this server), and namespace ownership is proven by a DNS TXT
69 record on `sigit.si`. The internal setup and release runbook live with the
70 server (private `sigit-si` repo).