gitcode-api 1.2.7__py3-none-any.whl → 1.2.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gitcode_api/cli.py CHANGED
@@ -1,7 +1,6 @@
1
1
  """Command-line interface for the GitCode SDK."""
2
2
 
3
3
  import argparse
4
- import asyncio
5
4
  import inspect
6
5
  import json
7
6
  import re
gitcode_api/llm/_tool.py CHANGED
@@ -3,9 +3,9 @@
3
3
  import base64
4
4
  import inspect
5
5
  import logging
6
+ import os
6
7
  from collections.abc import Mapping
7
8
  from functools import lru_cache
8
- import os
9
9
  from typing import Any, Callable, Dict, Optional, Tuple
10
10
 
11
11
  from gitcode_api import (
@@ -38,9 +38,7 @@ MCP_SERVER_INSTRUCTIONS = (
38
38
  "Successful results are JSON-serializable. Raw bytes from endpoints such as contents.get_raw are "
39
39
  'returned as {"encoding": "base64", "data": "<ascii>"}.\n'
40
40
  'Failures are objects with "error": true and a "message" string.\n\n'
41
- "Valid op_type values for this client version:\n- "
42
- + "\n- ".join(OP_TYPE_ENUM)
43
- + "\n\n"
41
+ "Valid op_type values for this client version:\n- " + "\n- ".join(OP_TYPE_ENUM) + "\n\n"
44
42
  "Optional MCP resources (read without calling the tool):\n"
45
43
  "- gitcode-api://help — markdown index of help URIs\n"
46
44
  "- gitcode-api://help/{op_type} — plain-text method list for that client resource\n"
gitcode_api/llm/mcp.py CHANGED
@@ -89,9 +89,7 @@ def register_mcp_help_resources(mcp: Union["FastMCP", Any]) -> None:
89
89
  @mcp.resource(
90
90
  "gitcode-api://help/{op_type}",
91
91
  name="gitcode_api_op_type_help",
92
- description=(
93
- "Method list for one op_type (same as gitcode_api_tool with help=true and empty action)."
94
- ),
92
+ description=("Method list for one op_type (same as gitcode_api_tool with help=true and empty action)."),
95
93
  mime_type="text/plain",
96
94
  )
97
95
  async def _op_type_help_resource(op_type: str) -> str:
@@ -132,9 +130,7 @@ class GitCodeMCP:
132
130
  return getattr(self.mcp, name)
133
131
 
134
132
 
135
- def create_mcp_server(
136
- name: str = "GitCode API", tool: Optional[GitCodeLLMTool] = None, **kwargs: Any
137
- ) -> "FastMCP":
133
+ def create_mcp_server(name: str = "GitCode API", tool: Optional[GitCodeLLMTool] = None, **kwargs: Any) -> "FastMCP":
138
134
  """Create a FastMCP server with the GitCode API tool already registered.
139
135
 
140
136
  :param name: MCP server display name.
gitcode_api/run_mcp.py ADDED
@@ -0,0 +1,6 @@
1
+ """Directly run GitCodeMCP."""
2
+
3
+ from gitcode_api.llm.mcp import GitCodeMCP
4
+
5
+ if __name__ == "__main__":
6
+ GitCodeMCP().mcp.run()
gitcode_api/version.txt CHANGED
@@ -1 +1 @@
1
- 1.2.7
1
+ 1.2.8
@@ -1,13 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitcode-api
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: Easy to use Python SDK for the GitCode REST API. Providing builtin CLI tool, and optional LLM integration (MCP and OpenAI tool) for agents. Community-maintained.
5
5
  Author-email: Hugo Huang <hugo@hugohuang.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: changelog, https://gitcode-api.readthedocs.io/en/latest/changelog.html
8
+ Project-URL: issues, https://github.com/Trenza1ore/GitCode-API/issues
8
9
  Project-URL: documentation, https://gitcode-api.readthedocs.io
9
10
  Project-URL: gitcode, https://gitcode.com/SushiNinja/GitCode-API
10
11
  Project-URL: github, https://github.com/Trenza1ore/GitCode-API
12
+ Project-URL: homepage, https://linktr.ee/Hugoooo
13
+ Project-URL: author, https://hugohuang.com
11
14
  Keywords: gitcode,git,devops,api,sdk,python,httpx,client,mcp,agent,fastmcp,llm,mcp client,mcp server,model context protocol
12
15
  Classifier: Development Status :: 4 - Beta
13
16
  Classifier: Programming Language :: Python
@@ -312,6 +315,8 @@ The same server is available from the CLI as `gitcode-api serve` (see the [CLI](
312
315
 
313
316
  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`.
314
317
 
318
+ **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`).
319
+
315
320
  ## Examples
316
321
 
317
322
  Runnable examples live in `examples/`:
@@ -6,12 +6,13 @@ gitcode_api/_cli_banner.py,sha256=3DsoJ2qZ-mWWB4yD-cnxDN_osXzrUKabrA5tbV6752M,97
6
6
  gitcode_api/_client.py,sha256=bmZxBHdfshM5Kv_EurHUVu8rsEj0k3Up3ATSIPaFrvc,8258
7
7
  gitcode_api/_exceptions.py,sha256=T5N8gBGmPSktDkLP5P_hxbzOHw3W378TzxN1xja40pA,1140
8
8
  gitcode_api/_models.py,sha256=v-GZzCGAb3_frY6wFiQww9m271U5MigivpEHDHnoDcI,109030
9
- gitcode_api/cli.py,sha256=DpnyGP54CkMGWwc8Krakt9i8RtAAsV45sN2UfgwMdIA,16631
9
+ gitcode_api/cli.py,sha256=7LLDRCKJg7avaLgIwckZZC5LewSpMPWNQFFDRhAQkEs,16616
10
10
  gitcode_api/py.typed,sha256=mDShSrm8qg9qjacQc2F-rI8ATllqP6EdgHuEYxuCXZ0,7
11
- gitcode_api/version.txt,sha256=2ejoQpxqfQuWXk-sJqXv_3ED8FX6qYzOtb1HMf0kYDo,6
11
+ gitcode_api/run_mcp.py,sha256=a7zNrcAooGovzokJwTHQGj6iT4g7iltaUoD_E1KLvMg,130
12
+ gitcode_api/version.txt,sha256=0tMVNGQdoBgBUSo-x5O8jVcTLUzvoZpftQPomV85648,6
12
13
  gitcode_api/llm/__init__.py,sha256=nCWs5jCnSxC9ILhiAh4vrNG0dVxkK3iqVz66c-0sE4I,1450
13
- gitcode_api/llm/_tool.py,sha256=piKizg127X_n4j517d6leyWbDMBVVTL7WwSvP6EtufQ,16247
14
- gitcode_api/llm/mcp.py,sha256=kaw5mnKfLExTPLY2y1tyGso0LKLAY7uY78kn4Fl3b-k,5730
14
+ gitcode_api/llm/_tool.py,sha256=mBQPYzQ-SuSWgumapcjv3pjGQfcPYt-IxUXBT5un2Lk,16239
15
+ gitcode_api/llm/mcp.py,sha256=eeAuEETZ4THw31wbcnQaTlZQJ-9ZolvsejQY630OqHs,5702
15
16
  gitcode_api/llm/openai.py,sha256=CcS3tFntzAuN2HMbbQDctb54AnasU3n3a1Jr9LWAHwM,1998
16
17
  gitcode_api/resources/__init__.py,sha256=nsCKW0bFDZ5ombJZxLThmO82sOuF7o4OKUMRkAmwbwk,1725
17
18
  gitcode_api/resources/_shared.py,sha256=7bCym8bIfs818SiYYrBGI7-ZtiYlxECSDG3RduInu10,5387
@@ -19,9 +20,9 @@ gitcode_api/resources/account.py,sha256=mnc2p7wI-nBnHFNdWPNiHfmZpT6d3RDQC777gewt
19
20
  gitcode_api/resources/collaboration.py,sha256=8lyk78GTjVXddiE9fieutsMGovRjteGfTJcAhwLoR0M,101607
20
21
  gitcode_api/resources/misc.py,sha256=guDwh4cxbTVsSa7EivaYM3bKMJ8_Op4KucGbKEoayKE,22412
21
22
  gitcode_api/resources/repositories.py,sha256=EAK2znZhEsgVUu-NDEQslSEEYJzvb-kHuh4mW57y6sc,78178
22
- gitcode_api-1.2.7.dist-info/licenses/LICENSE,sha256=gOACXuWhMu6PJKVLr9RQbxX3HULnZIGNXCaMFJIXhoA,1067
23
- gitcode_api-1.2.7.dist-info/METADATA,sha256=bWfQFWXLXHJFpTqGPZxQRv35gjL41QV7J6ARBiRKvj0,20120
24
- gitcode_api-1.2.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
25
- gitcode_api-1.2.7.dist-info/entry_points.txt,sha256=dIPylJcgohIE2RRIlt3In2WzcwDK8TOdkL_ReKuij4o,53
26
- gitcode_api-1.2.7.dist-info/top_level.txt,sha256=gIlg0ptyOUHJT64ajOjWIhRPYgIQnMIvnhhnesw9fxU,12
27
- gitcode_api-1.2.7.dist-info/RECORD,,
23
+ gitcode_api-1.2.8.dist-info/licenses/LICENSE,sha256=gOACXuWhMu6PJKVLr9RQbxX3HULnZIGNXCaMFJIXhoA,1067
24
+ gitcode_api-1.2.8.dist-info/METADATA,sha256=xGX_RWA4_IiwVLLLGR1l58UVbiArZoocNxacHls7fU0,20698
25
+ gitcode_api-1.2.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
26
+ gitcode_api-1.2.8.dist-info/entry_points.txt,sha256=dIPylJcgohIE2RRIlt3In2WzcwDK8TOdkL_ReKuij4o,53
27
+ gitcode_api-1.2.8.dist-info/top_level.txt,sha256=gIlg0ptyOUHJT64ajOjWIhRPYgIQnMIvnhhnesw9fxU,12
28
+ gitcode_api-1.2.8.dist-info/RECORD,,