source-context-mcp 0.1.dev6__tar.gz → 0.1.dev8__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.
Files changed (25) hide show
  1. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/PKG-INFO +1 -1
  2. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/pyproject.toml +1 -1
  3. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/pyproject.toml.orig +1 -1
  4. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/core/settings.py +4 -1
  5. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/server.py +3 -1
  6. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/tools/base.py +36 -0
  7. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/tools/graph.py +17 -1
  8. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/README.md +0 -0
  9. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/__init__.py +0 -0
  10. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/__main__.py +0 -0
  11. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/cli.py +0 -0
  12. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/core/__init__.py +0 -0
  13. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/core/api_client.py +0 -0
  14. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/core/context.py +0 -0
  15. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/core/dependencies.py +0 -0
  16. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/core/metadata.py +0 -0
  17. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/prompts/__init__.py +0 -0
  18. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/prompts/analyze_architecture.py +0 -0
  19. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/prompts/prepare_for_change.py +0 -0
  20. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/prompts/summarize_file.py +0 -0
  21. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/py.typed +0 -0
  22. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/resources/__init__.py +0 -0
  23. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/tools/__init__.py +0 -0
  24. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/tools/debug.py +0 -0
  25. {source_context_mcp-0.1.dev6 → source_context_mcp-0.1.dev8}/src/source_context_mcp/tools/vector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: source-context-mcp
3
- Version: 0.1.dev6
3
+ Version: 0.1.dev8
4
4
  Summary: Local Model Context Protocol (MCP) server for Source Context code intelligence.
5
5
  Author: Le Ngoc Tu, Dang Huu Hieu, Huynh Phat Tai
6
6
  Author-email: Le Ngoc Tu <tuleaibk@gmail.com>, Dang Huu Hieu <danghuuhieu038@gmail.com>, Huynh Phat Tai <huynhphtai@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "source-context-mcp"
3
- version = "0.1.dev6"
3
+ version = "0.1.dev8"
4
4
  description = "Local Model Context Protocol (MCP) server for Source Context code intelligence."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "source-context-mcp"
3
- version = "0.1.dev6"
3
+ version = "0.1.dev8"
4
4
  description = "Local Model Context Protocol (MCP) server for Source Context code intelligence."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -84,7 +84,10 @@ def write_settings(settings: Settings):
84
84
  """
85
85
  CONFIG_DIR.mkdir(parents=True, exist_ok=True)
86
86
 
87
- data = settings.model_dump(exclude_none=True, mode="json")
87
+ data = {
88
+ k: (v.get_secret_value() if hasattr(v, "get_secret_value") else v)
89
+ for k, v in settings.model_dump(exclude_none=True).items()
90
+ }
88
91
 
89
92
  with CONFIG_FILE.open("wb") as f:
90
93
  tomli_w.dump(data, f)
@@ -27,7 +27,9 @@ call.
27
27
 
28
28
  Resolve scope before calling graph or search tools. Try get_path_settings(path) first if the user is working inside a \
29
29
  local checkout; fall back to default_workspace() if no path-specific config exists. Otherwise narrow down with \
30
- list_workspaces -> list_repositories -> list_branches -> list_projects.
30
+ list_workspaces -> list_repositories. Immediately call get_repository_overview(repository_id) to acquire the full \
31
+ architectural profile (frameworks, tech stack, subprojects, directory map, entrypoints) in one call. Use list_branches \
32
+ and list_projects only if you need a specific branch or subproject ID not already resolved.
31
33
 
32
34
  Once you have a project_id, use list_files_in_project for file_ids, then get_file_structure before get_file_content \
33
35
  when you only need an overview or a node_id - avoid reading full file contents unless necessary.
@@ -70,3 +70,39 @@ def register_tools(mcp: MCPServer) -> None:
70
70
  }
71
71
  res = await client.post("/general/projects", req_body)
72
72
  return res.result()
73
+
74
+ @mcp.tool(
75
+ description="Get a comprehensive technical overview and architecture summary of a repository in ONE single "
76
+ "call. Returns summary, primary language, frameworks, tech stack, sub-projects (e.g. backend/frontend), "
77
+ "key entrypoints, and directory structure map. "
78
+ "CRITICAL: ALWAYS call this tool FIRST when beginning to explore or analyze any repository, before "
79
+ "attempting to list files or read directories. This single call gives you the complete architectural "
80
+ "blueprint and entrypoints, drastically reducing exploratory tool calls and token consumption."
81
+ )
82
+ async def get_repository_overview(
83
+ client: ApiClientDep,
84
+ repository_id: Annotated[int, Field(description="Repository ID.", ge=1)],
85
+ workspace_id: Annotated[
86
+ int | None,
87
+ Field(
88
+ default=None,
89
+ description="Optional Workspace ID. If omitted, resolved across accessible workspaces.",
90
+ ge=1,
91
+ ),
92
+ ] = None,
93
+ include_readme: Annotated[
94
+ bool,
95
+ Field(
96
+ default=False,
97
+ description="Whether to include full raw README markdown (default False to conserve tokens).",
98
+ ),
99
+ ] = False,
100
+ ) -> Any:
101
+ req_body: dict[str, Any] = {
102
+ "repository_id": repository_id,
103
+ "include_readme": include_readme,
104
+ }
105
+ if workspace_id is not None:
106
+ req_body["workspace_id"] = workspace_id
107
+ res = await client.post("/general/repository-overview", req_body)
108
+ return res.result()
@@ -1,4 +1,4 @@
1
- from typing import Annotated, Any, Literal
1
+ from typing import Annotated, Any
2
2
 
3
3
  from mcp.server import MCPServer
4
4
  from pydantic import Field
@@ -74,3 +74,19 @@ def register_tools(mcp: MCPServer) -> None:
74
74
  ) -> Any:
75
75
  res = await client.get(f"/graph/nodes/{node_id}/callees")
76
76
  return res.result()
77
+
78
+ @mcp.tool(description="Find functions, methods and classes in a project that are not referenced anywhere.")
79
+ async def find_unused_nodes_in_project(
80
+ client: ApiClientDep,
81
+ project_id: Annotated[str, Field(description="Project ID.")],
82
+ ) -> Any:
83
+ res = await client.get(f"/graph/projects/{project_id}/unused-nodes")
84
+ return res.result()
85
+
86
+ @mcp.tool(description="Find functions, methods and classes in a file that are not referenced anywhere.")
87
+ async def find_unused_nodes_in_file(
88
+ client: ApiClientDep,
89
+ file_id: Annotated[str, Field(description="File ID.")],
90
+ ) -> Any:
91
+ res = await client.get(f"/graph/files/{file_id}/unused-nodes")
92
+ return res.result()