contextlayer-mcp-server 0.1.0__tar.gz → 0.1.3__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.
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/PKG-INFO +1 -1
- contextlayer_mcp_server-0.1.3/contextlayer/server.py +59 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer_mcp_server.egg-info/PKG-INFO +1 -1
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/pyproject.toml +1 -1
- contextlayer_mcp_server-0.1.0/contextlayer/server.py +0 -26
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer/__init__.py +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer/detection.py +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer/wrapper.py +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer_mcp_server.egg-info/SOURCES.txt +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer_mcp_server.egg-info/dependency_links.txt +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer_mcp_server.egg-info/entry_points.txt +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer_mcp_server.egg-info/requires.txt +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/contextlayer_mcp_server.egg-info/top_level.txt +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/setup.cfg +0 -0
- {contextlayer_mcp_server-0.1.0 → contextlayer_mcp_server-0.1.3}/tests/test_detection.py +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""MCP server entry point. Run with: python -m contextlayer.server"""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from mcp.server.mcpserver import MCPServer
|
|
5
|
+
|
|
6
|
+
from contextlayer.detection import build_project_context
|
|
7
|
+
from contextlayer.wrapper import build_expert_prompt
|
|
8
|
+
|
|
9
|
+
mcp = MCPServer("ContextLayer-SE")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@mcp.tool()
|
|
13
|
+
def analyze_and_wrap_prompt(user_prompt: str, current_working_dir: str) -> str:
|
|
14
|
+
"""Detect the project's tech stack, then wrap `user_prompt` in a
|
|
15
|
+
strict senior-engineer schema before the model ever sees it."""
|
|
16
|
+
ctx = build_project_context(current_working_dir)
|
|
17
|
+
return build_expert_prompt(user_prompt, ctx)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main() -> None:
|
|
21
|
+
import anyio
|
|
22
|
+
anyio.run(mcp.run_stdio_async)
|
|
23
|
+
"""MCP server entry point. Run with: python -m contextlayer.server"""
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
import sys
|
|
26
|
+
from mcp.server.mcpserver import MCPServer
|
|
27
|
+
from contextlayer.detection import build_project_context
|
|
28
|
+
from contextlayer.wrapper import build_expert_prompt
|
|
29
|
+
|
|
30
|
+
mcp = MCPServer("ContextLayer-SE")
|
|
31
|
+
|
|
32
|
+
@mcp.tool()
|
|
33
|
+
def analyze_and_wrap_prompt(user_prompt: str, current_working_dir: str) -> str:
|
|
34
|
+
"""Detect the project's tech stack, then wrap `user_prompt` in a
|
|
35
|
+
strict senior-engineer schema before the model ever sees it."""
|
|
36
|
+
ctx = build_project_context(current_working_dir)
|
|
37
|
+
return build_expert_prompt(user_prompt, ctx)
|
|
38
|
+
|
|
39
|
+
def main() -> None:
|
|
40
|
+
# --- ONBOARDING BANNER START ---
|
|
41
|
+
banner = """
|
|
42
|
+
=======================================================
|
|
43
|
+
🚀 ContextLayer is running!
|
|
44
|
+
|
|
45
|
+
To use it, just ask your AI:
|
|
46
|
+
"Use the analyze_and_wrap_prompt tool with my current directory."
|
|
47
|
+
|
|
48
|
+
If you need help, check the docs or reply to this message.
|
|
49
|
+
=======================================================
|
|
50
|
+
"""
|
|
51
|
+
print(banner, file=sys.stderr)
|
|
52
|
+
# --- ONBOARDING BANNER END ---
|
|
53
|
+
|
|
54
|
+
import anyio
|
|
55
|
+
anyio.run(mcp.run_stdio_async)
|
|
56
|
+
|
|
57
|
+
if __name__ == "__main__":
|
|
58
|
+
main()
|
|
59
|
+
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"""MCP server entry point. Run with: python -m contextlayer.server"""
|
|
2
|
-
from __future__ import annotations
|
|
3
|
-
|
|
4
|
-
from mcp.server.mcpserver import MCPServer
|
|
5
|
-
|
|
6
|
-
from contextlayer.detection import build_project_context
|
|
7
|
-
from contextlayer.wrapper import build_expert_prompt
|
|
8
|
-
|
|
9
|
-
mcp = MCPServer("ContextLayer-SE")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@mcp.tool()
|
|
13
|
-
def analyze_and_wrap_prompt(user_prompt: str, current_working_dir: str) -> str:
|
|
14
|
-
"""Detect the project's tech stack, then wrap `user_prompt` in a
|
|
15
|
-
strict senior-engineer schema before the model ever sees it."""
|
|
16
|
-
ctx = build_project_context(current_working_dir)
|
|
17
|
-
return build_expert_prompt(user_prompt, ctx)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def main() -> None:
|
|
21
|
-
import anyio
|
|
22
|
-
anyio.run(mcp.run_stdio_async)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if __name__ == "__main__":
|
|
26
|
-
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|