codesurface 0.1.0__tar.gz

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.
@@ -0,0 +1,26 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.13"
18
+
19
+ - name: Install build tools
20
+ run: pip install build
21
+
22
+ - name: Build wheel and sdist
23
+ run: python -m build
24
+
25
+ - name: Publish to PyPI
26
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,10 @@
1
+ .venv/
2
+ venv/
3
+ __pycache__/
4
+ *.pyc
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ uv.lock
9
+ .env
10
+ .idea
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Codeturion
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,196 @@
1
+ Metadata-Version: 2.4
2
+ Name: codesurface
3
+ Version: 0.1.0
4
+ Summary: MCP server that indexes a C# codebase's public API at startup and serves it via compact tool responses — saving tokens vs reading source files
5
+ Project-URL: Homepage, https://github.com/Codeturion/codesurface
6
+ Project-URL: Repository, https://github.com/Codeturion/codesurface
7
+ Project-URL: Issues, https://github.com/Codeturion/codesurface/issues
8
+ Author-email: Codeturion <fuatcankoseoglu@gmail.com>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 Codeturion
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: api,code-intelligence,csharp,dotnet,index,mcp,unity
32
+ Classifier: Development Status :: 3 - Alpha
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
+ Classifier: Topic :: Software Development :: Libraries
41
+ Requires-Python: >=3.10
42
+ Requires-Dist: mcp[cli]>=1.8.0
43
+ Description-Content-Type: text/markdown
44
+
45
+ # codesurface
46
+
47
+ [![PyPI Version](https://img.shields.io/pypi/v/codesurface.svg)](https://pypi.org/project/codesurface/)
48
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/codesurface.svg)](https://pypi.org/project/codesurface/)
49
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
50
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
51
+
52
+ **MCP server that indexes a C# codebase's public API at startup and serves it via compact tool responses — saving tokens vs reading source files.**
53
+
54
+ Parses all `.cs` files, extracts public classes/methods/properties/fields/events, and serves them through 5 MCP tools. Works with Claude Code, Cursor, Windsurf, or any MCP-compatible AI tool.
55
+
56
+ ## Quick Start
57
+
58
+ ```bash
59
+ pip install codesurface
60
+ ```
61
+
62
+ Then add to your `.mcp.json`:
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "codesurface": {
68
+ "command": "codesurface",
69
+ "args": ["--project", "/path/to/your/src"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ Point `--project` at any directory containing `.cs` files — a Unity `Assets/Scripts` folder, a .NET `src/` tree, a Godot C# project, etc.
76
+
77
+ Restart your AI tool and ask: *"What methods does MyService have?"*
78
+
79
+ ## Tools
80
+
81
+ | Tool | Purpose | Example |
82
+ |------|---------|---------|
83
+ | `search` | Find APIs by keyword | "MergeService", "BlastBoard", "GridCoord" |
84
+ | `get_signature` | Exact signature by name or FQN | "TryMerge", "CampGame.Services.IMergeService.TryMerge" |
85
+ | `get_class` | Full class reference card — all public members | "BlastBoardModel" → all methods/fields/properties |
86
+ | `get_stats` | Overview of indexed codebase | File count, record counts, namespace breakdown |
87
+ | `reindex` | Incremental index update (mtime-based) | Only re-parses changed/new/deleted files |
88
+
89
+ ## Benchmarks
90
+
91
+ Measured against a real Unity game project (129 files, 1,018 API records) across a 10-step cross-cutting research workflow.
92
+
93
+ | Strategy | Total Tokens | vs MCP |
94
+ |----------|-------------|--------|
95
+ | **MCP (codesurface)** | **1,021** | — |
96
+ | Skilled Agent (Grep + partial Read) | 4,453 | 4.4x more |
97
+ | Naive Agent (Grep + full Read) | 11,825 | 11.6x more |
98
+
99
+ Even with follow-up reads for implementation detail, the hybrid MCP + targeted Read approach uses **54% fewer tokens** than a skilled Grep+Read agent.
100
+
101
+ See [workflow-benchmark.md](workflow-benchmark.md) for the full step-by-step analysis.
102
+
103
+ ## Setup Details
104
+
105
+ <details>
106
+ <summary>Claude Code configuration</summary>
107
+
108
+ Add to `<project>/.mcp.json`:
109
+
110
+ **Using uv (recommended):**
111
+ ```json
112
+ {
113
+ "mcpServers": {
114
+ "codesurface": {
115
+ "command": "uv",
116
+ "args": ["run", "--directory", "/path/to/codesurface", "codesurface", "--project", "/path/to/your/src"]
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ **Using pip install:**
123
+ ```json
124
+ {
125
+ "mcpServers": {
126
+ "codesurface": {
127
+ "command": "codesurface",
128
+ "args": ["--project", "/path/to/your/src"]
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ </details>
135
+
136
+ <details>
137
+ <summary>CLAUDE.md snippet (recommended)</summary>
138
+
139
+ Add to your project's `CLAUDE.md` so the AI knows when to use the tools:
140
+
141
+ ```markdown
142
+ ## Codebase API Lookup (codesurface MCP)
143
+
144
+ Use the `codesurface` MCP tools to look up your project's classes, methods, properties, and fields instead of reading source files.
145
+
146
+ | When | Tool | Example |
147
+ |------|------|---------|
148
+ | Searching for an API by keyword | `search` | `search("MergeService")` |
149
+ | Need exact method signature | `get_signature` | `get_signature("TryMerge")` |
150
+ | Want all members on a class | `get_class` | `get_class("BlastBoardModel")` |
151
+ | Overview of indexed codebase | `get_stats` | `get_stats()` |
152
+ | After creating/deleting C# files | `reindex` | `reindex()` |
153
+ ```
154
+
155
+ </details>
156
+
157
+ <details>
158
+ <summary>Project structure</summary>
159
+
160
+ ```
161
+ codesurface/
162
+ ├── src/codesurface/
163
+ │ ├── server.py # MCP server — 5 tools
164
+ │ ├── db.py # SQLite + FTS5 database layer
165
+ │ └── cs_parser.py # C# public API parser
166
+ ├── pyproject.toml
167
+ └── README.md
168
+ ```
169
+
170
+ </details>
171
+
172
+ <details>
173
+ <summary>Troubleshooting</summary>
174
+
175
+ **"No codebase indexed"**
176
+ - Ensure `--project` points to a directory containing `.cs` files
177
+ - The server indexes at startup — check stderr for the "Indexed N records" message
178
+
179
+ **Server won't start**
180
+ - Check Python version: `python --version` (needs 3.10+)
181
+ - Check `mcp[cli]` is installed: `pip install mcp[cli]`
182
+
183
+ **Stale results after editing C# files**
184
+ - Call `reindex()` — only re-parses files whose modification time changed, fast even on large codebases
185
+
186
+ </details>
187
+
188
+ ---
189
+
190
+ ## Contact
191
+
192
+ fuatcankoseoglu@gmail.com
193
+
194
+ ## License
195
+
196
+ MIT
@@ -0,0 +1,152 @@
1
+ # codesurface
2
+
3
+ [![PyPI Version](https://img.shields.io/pypi/v/codesurface.svg)](https://pypi.org/project/codesurface/)
4
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/codesurface.svg)](https://pypi.org/project/codesurface/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
+
8
+ **MCP server that indexes a C# codebase's public API at startup and serves it via compact tool responses — saving tokens vs reading source files.**
9
+
10
+ Parses all `.cs` files, extracts public classes/methods/properties/fields/events, and serves them through 5 MCP tools. Works with Claude Code, Cursor, Windsurf, or any MCP-compatible AI tool.
11
+
12
+ ## Quick Start
13
+
14
+ ```bash
15
+ pip install codesurface
16
+ ```
17
+
18
+ Then add to your `.mcp.json`:
19
+
20
+ ```json
21
+ {
22
+ "mcpServers": {
23
+ "codesurface": {
24
+ "command": "codesurface",
25
+ "args": ["--project", "/path/to/your/src"]
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ Point `--project` at any directory containing `.cs` files — a Unity `Assets/Scripts` folder, a .NET `src/` tree, a Godot C# project, etc.
32
+
33
+ Restart your AI tool and ask: *"What methods does MyService have?"*
34
+
35
+ ## Tools
36
+
37
+ | Tool | Purpose | Example |
38
+ |------|---------|---------|
39
+ | `search` | Find APIs by keyword | "MergeService", "BlastBoard", "GridCoord" |
40
+ | `get_signature` | Exact signature by name or FQN | "TryMerge", "CampGame.Services.IMergeService.TryMerge" |
41
+ | `get_class` | Full class reference card — all public members | "BlastBoardModel" → all methods/fields/properties |
42
+ | `get_stats` | Overview of indexed codebase | File count, record counts, namespace breakdown |
43
+ | `reindex` | Incremental index update (mtime-based) | Only re-parses changed/new/deleted files |
44
+
45
+ ## Benchmarks
46
+
47
+ Measured against a real Unity game project (129 files, 1,018 API records) across a 10-step cross-cutting research workflow.
48
+
49
+ | Strategy | Total Tokens | vs MCP |
50
+ |----------|-------------|--------|
51
+ | **MCP (codesurface)** | **1,021** | — |
52
+ | Skilled Agent (Grep + partial Read) | 4,453 | 4.4x more |
53
+ | Naive Agent (Grep + full Read) | 11,825 | 11.6x more |
54
+
55
+ Even with follow-up reads for implementation detail, the hybrid MCP + targeted Read approach uses **54% fewer tokens** than a skilled Grep+Read agent.
56
+
57
+ See [workflow-benchmark.md](workflow-benchmark.md) for the full step-by-step analysis.
58
+
59
+ ## Setup Details
60
+
61
+ <details>
62
+ <summary>Claude Code configuration</summary>
63
+
64
+ Add to `<project>/.mcp.json`:
65
+
66
+ **Using uv (recommended):**
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "codesurface": {
71
+ "command": "uv",
72
+ "args": ["run", "--directory", "/path/to/codesurface", "codesurface", "--project", "/path/to/your/src"]
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ **Using pip install:**
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "codesurface": {
83
+ "command": "codesurface",
84
+ "args": ["--project", "/path/to/your/src"]
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ </details>
91
+
92
+ <details>
93
+ <summary>CLAUDE.md snippet (recommended)</summary>
94
+
95
+ Add to your project's `CLAUDE.md` so the AI knows when to use the tools:
96
+
97
+ ```markdown
98
+ ## Codebase API Lookup (codesurface MCP)
99
+
100
+ Use the `codesurface` MCP tools to look up your project's classes, methods, properties, and fields instead of reading source files.
101
+
102
+ | When | Tool | Example |
103
+ |------|------|---------|
104
+ | Searching for an API by keyword | `search` | `search("MergeService")` |
105
+ | Need exact method signature | `get_signature` | `get_signature("TryMerge")` |
106
+ | Want all members on a class | `get_class` | `get_class("BlastBoardModel")` |
107
+ | Overview of indexed codebase | `get_stats` | `get_stats()` |
108
+ | After creating/deleting C# files | `reindex` | `reindex()` |
109
+ ```
110
+
111
+ </details>
112
+
113
+ <details>
114
+ <summary>Project structure</summary>
115
+
116
+ ```
117
+ codesurface/
118
+ ├── src/codesurface/
119
+ │ ├── server.py # MCP server — 5 tools
120
+ │ ├── db.py # SQLite + FTS5 database layer
121
+ │ └── cs_parser.py # C# public API parser
122
+ ├── pyproject.toml
123
+ └── README.md
124
+ ```
125
+
126
+ </details>
127
+
128
+ <details>
129
+ <summary>Troubleshooting</summary>
130
+
131
+ **"No codebase indexed"**
132
+ - Ensure `--project` points to a directory containing `.cs` files
133
+ - The server indexes at startup — check stderr for the "Indexed N records" message
134
+
135
+ **Server won't start**
136
+ - Check Python version: `python --version` (needs 3.10+)
137
+ - Check `mcp[cli]` is installed: `pip install mcp[cli]`
138
+
139
+ **Stale results after editing C# files**
140
+ - Call `reindex()` — only re-parses files whose modification time changed, fast even on large codebases
141
+
142
+ </details>
143
+
144
+ ---
145
+
146
+ ## Contact
147
+
148
+ fuatcankoseoglu@gmail.com
149
+
150
+ ## License
151
+
152
+ MIT
@@ -0,0 +1,40 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "codesurface"
7
+ version = "0.1.0"
8
+ description = "MCP server that indexes a C# codebase's public API at startup and serves it via compact tool responses — saving tokens vs reading source files"
9
+ readme = "README.md"
10
+ license = {file = "LICENSE"}
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ {name = "Codeturion", email = "fuatcankoseoglu@gmail.com"},
14
+ ]
15
+ keywords = ["mcp", "csharp", "api", "index", "code-intelligence", "unity", "dotnet"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Software Development :: Libraries",
26
+ ]
27
+ dependencies = [
28
+ "mcp[cli]>=1.8.0",
29
+ ]
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/Codeturion/codesurface"
33
+ Repository = "https://github.com/Codeturion/codesurface"
34
+ Issues = "https://github.com/Codeturion/codesurface/issues"
35
+
36
+ [project.scripts]
37
+ codesurface = "codesurface.server:main"
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ packages = ["src/codesurface"]
File without changes