You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/gitcode-api/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ with GitCode(
112
112
113
113
## Repository-scoped defaults
114
114
115
-
If `owner=` and `repo=` are set on the client, repository resources can omit them per call. If not, pass `owner=` and `repo=` on repository-scoped methods.
115
+
If `owner` and `repo` are set on the client, repository resources can omit them per call. If not, pass `owner` and `repo` on repository-scoped methods.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ Changes since `1.2.15`…`1.2.16`.
119
119
120
120
### Feature
121
121
122
-
-**Default CA Bundle:** When the internal `GitCode` client builds its own `httpx` client (you do not pass `http_client=`), verification uses the path from `GITCODE_CA_BUNDLE` if set, otherwise `REQUESTS_CA_BUNDLE` if set (same convention as many Python HTTP stacks), otherwise the default CA bundle is used. Applies to both `GitCode` and `AsyncGitCode`.
122
+
-**Default CA Bundle:** When the internal `GitCode` client builds its own `httpx` client (you do not pass `http_client`), verification uses the path from `GITCODE_CA_BUNDLE` if set, otherwise `REQUESTS_CA_BUNDLE` if set (same convention as many Python HTTP stacks), otherwise the default CA bundle is used. Applies to both `GitCode` and `AsyncGitCode`.
[](https://cursor.com/en/install-mcp?name=GitCode%20API&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJnaXRjb2RlLWFwaVttY3BdIiwiZ2l0Y29kZS1hcGkiLCJzZXJ2ZSJdLCJlbnYiOnsiR0lUQ09ERV9BQ0NFU1NfVE9LRU4iOiIke2lucHV0OmdpdGNvZGVfYWNjZXNzX3Rva2VufSJ9LCJpbnB1dHMiOlt7ImlkIjoiZ2l0Y29kZV9hY2Nlc3NfdG9rZW4iLCJ0eXBlIjoicHJvbXB0U3RyaW5nIiwiZGVzY3JpcHRpb24iOiJFbnRlciBHSVRDT0RFX0FDQ0VTU19UT0tFTiIsInBhc3N3b3JkIjp0cnVlfV19) [](https://vscode.dev/redirect/mcp/install?name=GitCode%20API&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22gitcode-api%5Bmcp%5D%22%2C%22gitcode-api%22%2C%22serve%22%5D%2C%22env%22%3A%7B%22GITCODE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agitcode_access_token%7D%22%7D%2C%22inputs%22%3A%5B%7B%22id%22%3A%22gitcode_access_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Enter%20GITCODE_ACCESS_TOKEN%22%2C%22password%22%3Atrue%7D%5D%7D)
`gitcode-api` is a community-maintained Python SDK for the GitCode REST API. It provides easy-to-use synchronous and asynchronous clients, repository-scoped helpers, and lightweight response models so you can work with GitCode from Python without hand-writing raw HTTP requests. The `gitcode_api.llm` module adds an OpenAI-style function tool, an MCP service, and an [openJiuwen](https://openjiuwen.com) tool integration so agents can reuse the same resource-oriented API.
6
+
`gitcode-api` is a community-maintained Python SDK for the GitCode REST API. It provides easy-to-use synchronous and asynchronous clients, helpers methods grouped by resource groups, and type-hinted response models so you can work with GitCode from Python without hand-writing raw HTTP requests. The `gitcode_api.llm` module adds an OpenAI-style function tool, an MCP service, and an [openJiuwen](https://openjiuwen.com) tool integration so agents can reuse the same resource-oriented API.
10
7
11
8
## Why This Project
12
9
13
10
- Community project for developers who want a practical GitCode Python library.
14
11
- Sync and async clients with a consistent API surface.
15
12
- Convenient methods not offered by REST API directly: such as fetching Issue and PR templates.
16
13
- Resource groups such as `client.repos`, `client.pulls`, and `client.users`.
17
-
- Repository defaults via `owner=` and `repo=` on the client.
14
+
- Repository defaults via `owner` and `repo` on the client.
18
15
- Sphinx docs plus a mirrored GitCode REST API reference in `docs/`.
19
16
- Provides MCP server, OpenAI tool, and [openJiuwen](https://openjiuwen.com) tool for LLM agent usage.
20
17
- Provide MCP service that directly installs to your IDE of choice, such as Cursor and VS Code!
@@ -40,14 +37,14 @@ For detailed setup (including installing to services like Claude Code / Codex):
40
37
41
38
## Authentication
42
39
43
-
Pass `api_key=` directly, or set `GITCODE_ACCESS_TOKEN` in your environment:
40
+
Pass `api_key` directly, or set `GITCODE_ACCESS_TOKEN` in your environment:
44
41
45
42
```bash
46
43
export GITCODE_ACCESS_TOKEN="your-token"
47
44
```
48
45
49
-
If your token is stored in encrypted form, pass `decrypt=` to decode either an
50
-
encrypted `api_key=` value or an encrypted `GITCODE_ACCESS_TOKEN` value before
46
+
If your token is stored in encrypted form, pass `decrypt` to decode either an
47
+
encrypted `api_key` value or an encrypted `GITCODE_ACCESS_TOKEN` value before
51
48
the client uses it.
52
49
53
50
```python
@@ -134,7 +131,7 @@ meta = as_dict(repo) # dict
134
131
135
132
### Context managers
136
133
137
-
`GitCode` and `AsyncGitCode` (and the lower-level `SyncAPIClient` / `AsyncAPIClient`) support `with` / `async with`. Leaving the block calls `close()` / `await close()` on the underlying client automatically, including a custom `http_client=` you passed in. `close()` also clears the LRU cache used by each resource group's `method_signature(...)` helper (see the [Available Resources](#available-resources) section).
134
+
`GitCode` and `AsyncGitCode` (and the lower-level `SyncAPIClient` / `AsyncAPIClient`) support `with` / `async with`. Leaving the block calls `close()` / `await close()` on the underlying client automatically, including a custom `http_client` you passed in. `close()` also clears the LRU cache used by each resource group's `method_signature(...)` helper (see the [Available Resources](#available-resources) section).
138
135
139
136
```python
140
137
from gitcode_api import GitCode
@@ -291,7 +288,7 @@ while True:
291
288
pip install 'gitcode-api[mcp]'
292
289
```
293
290
294
-
-**`create_mcp_server`** — builds a `FastMCP` instance with `gitcode_api_tool` already registered; optional `name=`, `tool=`, and extra keyword arguments are forwarded to `FastMCP(...)`.
291
+
-**`create_mcp_server`** — builds a `FastMCP` instance with `gitcode_api_tool` already registered; optional `name`, `tool`, and extra keyword arguments are forwarded to `FastMCP(...)`.
295
292
-**`GitCodeMCP`** — thin wrapper that constructs that server and registers the tool; unknown attributes are delegated to the underlying `FastMCP` object (for example transport helpers exposed by your FastMCP version).
296
293
-**`create_mcp_gitcode_api_tool`** — returns the standalone async callable used as the tool body (for custom wiring).
297
294
-**`register_mcp_gitcode_api_tool`** — attaches that callable to an existing FastMCP-compatible object (`mcp.tool(...)` or `mcp.add_tool(...)`).
The same server is available from the CLI as `gitcode-api serve` (see the [CLI](#cli) section).
307
304
308
-
To share auth or clients across tools, build `GitCodeLLMTool` once (`from gitcode_api.llm._tool import GitCodeLLMTool`) and pass it as `tool=` into `GitCodeMCP`, `create_mcp_server`, `register_mcp_gitcode_api_tool`, or `create_mcp_gitcode_api_tool`.
305
+
To share auth or clients across tools, build `GitCodeLLMTool` once (`from gitcode_api.llm._tool import GitCodeLLMTool`) and pass it as `tool` into `GitCodeMCP`, `create_mcp_server`, `register_mcp_gitcode_api_tool`, or `create_mcp_gitcode_api_tool`.
**Claude Desktop (MCPB):** published GitHub Releases include a `gitcode-<version>.mcpb` bundle for one-click installation as a Claude Desktop extension; see Anthropic’s guide, [Build a desktop extension with MCPB](https://claude.com/docs/connectors/building/mcpb). From a checkout you can run `make mcpb` (requires the [`@anthropic-ai/mcpb`](https://www.npmjs.com/package/@anthropic-ai/mcpb) CLI on your `PATH`).
329
326
@@ -394,7 +391,7 @@ with GitCode(
394
391
395
392
Use `httpx.AsyncClient(verify=...)` with `AsyncGitCode` for async code.
396
393
397
-
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client=` / `async_client=` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool=`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
394
+
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client` / `async_client` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
0 commit comments