codegraphcontext 0.1.11__tar.gz → 0.1.12__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.
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/LICENSE +0 -0
- codegraphcontext-0.1.12/MANIFEST.in +2 -0
- {codegraphcontext-0.1.11/src/codegraphcontext.egg-info → codegraphcontext-0.1.12}/PKG-INFO +15 -4
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/README.md +14 -3
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/pyproject.toml +1 -1
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/server.py +1 -9
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/graph_builder.py +16 -11
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/import_extractor.py +2 -8
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/system.py +1 -3
- codegraphcontext-0.1.12/src/codegraphcontext/utils/debug_log.py +10 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12/src/codegraphcontext.egg-info}/PKG-INFO +15 -4
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/SOURCES.txt +2 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/requires.txt +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/top_level.txt +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/tests/test_cgc_integration.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/tests/test_imports.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/tests/test_jsonrpc.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/tests/test_tools.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/setup.cfg +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/cli/main.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/code_finder.py +0 -0
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
4
4
|
Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
5
5
|
Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -56,15 +56,26 @@ Dynamic: license-file
|
|
|
56
56
|
[](https://pypi.org/project/codegraphcontext/)
|
|
57
57
|
[](https://github.com/Shashankss1205/CodeGraphContext/stargazers)
|
|
58
58
|
[](LICENSE)
|
|
59
|
-
[](http://
|
|
59
|
+
[](http://codegraphcontext.vercel.app/)
|
|
60
|
+
[](https://youtu.be/KYYSdxhg1xU)
|
|
61
|
+
[](https://discord.gg/dR4QY32uYQ)
|
|
60
62
|
|
|
61
63
|
An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
62
64
|
|
|
65
|
+
### Indexing a codebase
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
### Using the MCP server
|
|
69
|
+

|
|
70
|
+
|
|
63
71
|
## Project Details
|
|
64
72
|
- **Version:** 0.1.11
|
|
65
73
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
66
74
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
67
|
-
- **Website:** [CodeGraphContext](http://
|
|
75
|
+
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
76
|
+
|
|
77
|
+
## Star History
|
|
78
|
+
[](https://www.star-history.com/#Shashankss1205/CodeGraphContext&Date)
|
|
68
79
|
|
|
69
80
|
## Features
|
|
70
81
|
|
|
@@ -100,7 +111,7 @@ If you’re using CodeGraphContext in your project, feel free to open a PR and a
|
|
|
100
111
|
2. **Setup:** `cgc setup`
|
|
101
112
|
This interactive command guides you through configuring your Neo4j database connection and automatically setting up your IDE.
|
|
102
113
|
|
|
103
|
-
|
|
114
|
+
**Database Configuration:**
|
|
104
115
|
* **Local Setup (Docker Recommended):** Helps you set up a local Neo4j instance using Docker. Requires Docker and Docker Compose to be installed.
|
|
105
116
|
* **Local Setup (Linux Binary):** For Debian-based Linux systems (like Ubuntu), `cgc setup` can automate the installation of Neo4j. Requires `sudo` privileges.
|
|
106
117
|
* **Hosted Setup:** Allows you to connect to an existing remote Neo4j database (e.g., Neo4j AuraDB).
|
|
@@ -4,15 +4,26 @@
|
|
|
4
4
|
[](https://pypi.org/project/codegraphcontext/)
|
|
5
5
|
[](https://github.com/Shashankss1205/CodeGraphContext/stargazers)
|
|
6
6
|
[](LICENSE)
|
|
7
|
-
[](http://
|
|
7
|
+
[](http://codegraphcontext.vercel.app/)
|
|
8
|
+
[](https://youtu.be/KYYSdxhg1xU)
|
|
9
|
+
[](https://discord.gg/dR4QY32uYQ)
|
|
8
10
|
|
|
9
11
|
An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
10
12
|
|
|
13
|
+
### Indexing a codebase
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
### Using the MCP server
|
|
17
|
+

|
|
18
|
+
|
|
11
19
|
## Project Details
|
|
12
20
|
- **Version:** 0.1.11
|
|
13
21
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
14
22
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
15
|
-
- **Website:** [CodeGraphContext](http://
|
|
23
|
+
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
24
|
+
|
|
25
|
+
## Star History
|
|
26
|
+
[](https://www.star-history.com/#Shashankss1205/CodeGraphContext&Date)
|
|
16
27
|
|
|
17
28
|
## Features
|
|
18
29
|
|
|
@@ -48,7 +59,7 @@ If you’re using CodeGraphContext in your project, feel free to open a PR and a
|
|
|
48
59
|
2. **Setup:** `cgc setup`
|
|
49
60
|
This interactive command guides you through configuring your Neo4j database connection and automatically setting up your IDE.
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
**Database Configuration:**
|
|
52
63
|
* **Local Setup (Docker Recommended):** Helps you set up a local Neo4j instance using Docker. Requires Docker and Docker Compose to be installed.
|
|
53
64
|
* **Local Setup (Linux Binary):** For Debian-based Linux systems (like Ubuntu), `cgc setup` can automate the installation of Neo4j. Requires `sudo` privileges.
|
|
54
65
|
* **Hosted Setup:** Allows you to connect to an existing remote Neo4j database (e.g., Neo4j AuraDB).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.12"
|
|
4
4
|
description = "An MCP server that indexes local code into a graph database to provide context to AI assistants."
|
|
5
5
|
authors = [{ name = "Shashank Shekhar Singh", email = "shashankshekharsingh1205@gmail.com" }]
|
|
6
6
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -22,18 +22,10 @@ from .core.watcher import CodeWatcher
|
|
|
22
22
|
from .tools.graph_builder import GraphBuilder
|
|
23
23
|
from .tools.code_finder import CodeFinder
|
|
24
24
|
from .tools.import_extractor import ImportExtractor
|
|
25
|
-
|
|
25
|
+
from .utils.debug_log import debug_log
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
29
|
-
def debug_log(message):
|
|
30
|
-
"""Write debug message to a file for development and testing."""
|
|
31
|
-
debug_file = os.path.expanduser("~/mcp_debug.log")
|
|
32
|
-
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
33
|
-
with open(debug_file, "a") as f:
|
|
34
|
-
f.write(f"[{timestamp}] {message}\n")
|
|
35
|
-
f.flush()
|
|
36
|
-
|
|
37
29
|
class MCPServer:
|
|
38
30
|
"""
|
|
39
31
|
The main MCP Server class.
|
|
File without changes
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/graph_builder.py
RENAMED
|
@@ -9,6 +9,7 @@ from datetime import datetime
|
|
|
9
9
|
|
|
10
10
|
from ..core.database import DatabaseManager
|
|
11
11
|
from ..core.jobs import JobManager, JobStatus
|
|
12
|
+
from ..utils.debug_log import debug_log
|
|
12
13
|
|
|
13
14
|
logger = logging.getLogger(__name__)
|
|
14
15
|
|
|
@@ -16,15 +17,6 @@ logger = logging.getLogger(__name__)
|
|
|
16
17
|
# Set to 1 to enable, 0 to disable.
|
|
17
18
|
debug_mode = 0
|
|
18
19
|
|
|
19
|
-
def debug_log(message):
|
|
20
|
-
"""Write debug message to a file"""
|
|
21
|
-
debug_file = os.path.expanduser("~/mcp_debug.log")
|
|
22
|
-
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
23
|
-
with open(debug_file, "a") as f:
|
|
24
|
-
f.write(f"[{timestamp}] {message}\n")
|
|
25
|
-
f.flush()
|
|
26
|
-
|
|
27
|
-
|
|
28
20
|
class CyclomaticComplexityVisitor(ast.NodeVisitor):
|
|
29
21
|
"""Calculates cyclomatic complexity for a given AST node."""
|
|
30
22
|
def __init__(self):
|
|
@@ -985,16 +977,29 @@ class GraphBuilder:
|
|
|
985
977
|
""", path=path)
|
|
986
978
|
|
|
987
979
|
def delete_repository_from_graph(self, repo_path: str):
|
|
988
|
-
"""
|
|
980
|
+
"""
|
|
981
|
+
Deletes a repository and all its contents from the graph, then cleans up
|
|
982
|
+
any orphaned Module nodes that are no longer referenced.
|
|
983
|
+
"""
|
|
989
984
|
repo_path_str = str(Path(repo_path).resolve())
|
|
990
985
|
with self.driver.session() as session:
|
|
986
|
+
# Delete the repository and all its contained elements, including parameters
|
|
991
987
|
session.run("""
|
|
992
988
|
MATCH (r:Repository {path: $path})
|
|
993
989
|
OPTIONAL MATCH (r)-[:CONTAINS*]->(e)
|
|
994
|
-
|
|
990
|
+
OPTIONAL MATCH (e)-[:HAS_PARAMETER]->(p)
|
|
991
|
+
DETACH DELETE r, e, p
|
|
995
992
|
""", path=repo_path_str)
|
|
996
993
|
logger.info(f"Deleted repository and its contents from graph: {repo_path_str}")
|
|
997
994
|
|
|
995
|
+
# Clean up orphaned Module nodes that are no longer imported by any file
|
|
996
|
+
session.run("""
|
|
997
|
+
MATCH (m:Module)
|
|
998
|
+
WHERE NOT ()-[:IMPORTS]->(m)
|
|
999
|
+
DETACH DELETE m
|
|
1000
|
+
""")
|
|
1001
|
+
logger.info("Cleaned up orphaned Module nodes.")
|
|
1002
|
+
|
|
998
1003
|
def update_file_in_graph(self, file_path: Path, repo_path: Path, imports_map: dict):
|
|
999
1004
|
"""
|
|
1000
1005
|
Updates a single file's nodes in the graph and returns its new parsed data.
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/import_extractor.py
RENAMED
|
@@ -13,15 +13,9 @@ import stdlibs
|
|
|
13
13
|
import os
|
|
14
14
|
from datetime import datetime
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
from ..utils.debug_log import debug_log
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
"""Write debug message to a file for development and testing."""
|
|
20
|
-
debug_file = os.path.expanduser("~/mcp_debug.log")
|
|
21
|
-
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
22
|
-
with open(debug_file, "a") as f:
|
|
23
|
-
f.write(f"[{timestamp}] {message}\n")
|
|
24
|
-
f.flush()
|
|
18
|
+
logger = logging.getLogger(__name__)
|
|
25
19
|
|
|
26
20
|
class ImportExtractor:
|
|
27
21
|
"""
|
|
@@ -8,12 +8,10 @@ from neo4j.exceptions import CypherSyntaxError
|
|
|
8
8
|
|
|
9
9
|
from ..core.database import DatabaseManager
|
|
10
10
|
from ..core.jobs import JobManager, JobStatus
|
|
11
|
+
from ..utils.debug_log import debug_log
|
|
11
12
|
|
|
12
13
|
logger = logging.getLogger(__name__)
|
|
13
14
|
|
|
14
|
-
def debug_log(message):
|
|
15
|
-
# This helper can be moved to a shared utils.py file later
|
|
16
|
-
...
|
|
17
15
|
|
|
18
16
|
class SystemTools:
|
|
19
17
|
"""Handles system-level tools like job management and direct DB queries."""
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
|
|
4
|
+
def debug_log(message):
|
|
5
|
+
"""Write debug message to a file"""
|
|
6
|
+
debug_file = os.path.expanduser("~/mcp_debug.log")
|
|
7
|
+
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
8
|
+
with open(debug_file, "a") as f:
|
|
9
|
+
f.write(f"[{timestamp}] {message}\n")
|
|
10
|
+
f.flush()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
4
4
|
Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
5
5
|
Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -56,15 +56,26 @@ Dynamic: license-file
|
|
|
56
56
|
[](https://pypi.org/project/codegraphcontext/)
|
|
57
57
|
[](https://github.com/Shashankss1205/CodeGraphContext/stargazers)
|
|
58
58
|
[](LICENSE)
|
|
59
|
-
[](http://
|
|
59
|
+
[](http://codegraphcontext.vercel.app/)
|
|
60
|
+
[](https://youtu.be/KYYSdxhg1xU)
|
|
61
|
+
[](https://discord.gg/dR4QY32uYQ)
|
|
60
62
|
|
|
61
63
|
An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
62
64
|
|
|
65
|
+
### Indexing a codebase
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
### Using the MCP server
|
|
69
|
+

|
|
70
|
+
|
|
63
71
|
## Project Details
|
|
64
72
|
- **Version:** 0.1.11
|
|
65
73
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
66
74
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
67
|
-
- **Website:** [CodeGraphContext](http://
|
|
75
|
+
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
76
|
+
|
|
77
|
+
## Star History
|
|
78
|
+
[](https://www.star-history.com/#Shashankss1205/CodeGraphContext&Date)
|
|
68
79
|
|
|
69
80
|
## Features
|
|
70
81
|
|
|
@@ -100,7 +111,7 @@ If you’re using CodeGraphContext in your project, feel free to open a PR and a
|
|
|
100
111
|
2. **Setup:** `cgc setup`
|
|
101
112
|
This interactive command guides you through configuring your Neo4j database connection and automatically setting up your IDE.
|
|
102
113
|
|
|
103
|
-
|
|
114
|
+
**Database Configuration:**
|
|
104
115
|
* **Local Setup (Docker Recommended):** Helps you set up a local Neo4j instance using Docker. Requires Docker and Docker Compose to be installed.
|
|
105
116
|
* **Local Setup (Linux Binary):** For Debian-based Linux systems (like Ubuntu), `cgc setup` can automate the installation of Neo4j. Requires `sudo` privileges.
|
|
106
117
|
* **Hosted Setup:** Allows you to connect to an existing remote Neo4j database (e.g., Neo4j AuraDB).
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/SOURCES.txt
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
2
3
|
README.md
|
|
3
4
|
pyproject.toml
|
|
4
5
|
src/codegraphcontext/__init__.py
|
|
@@ -23,6 +24,7 @@ src/codegraphcontext/tools/code_finder.py
|
|
|
23
24
|
src/codegraphcontext/tools/graph_builder.py
|
|
24
25
|
src/codegraphcontext/tools/import_extractor.py
|
|
25
26
|
src/codegraphcontext/tools/system.py
|
|
27
|
+
src/codegraphcontext/utils/debug_log.py
|
|
26
28
|
tests/test_cgc_integration.py
|
|
27
29
|
tests/test_imports.py
|
|
28
30
|
tests/test_jsonrpc.py
|
|
File without changes
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/requires.txt
RENAMED
|
File without changes
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/cli/setup_wizard.py
RENAMED
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.1.11 → codegraphcontext-0.1.12}/src/codegraphcontext/tools/code_finder.py
RENAMED
|
File without changes
|