Skip to content

Commit f2005ca

Browse files
committed
update mcp
1 parent 71d3478 commit f2005ca

File tree

1 file changed

+3
-39
lines changed

1 file changed

+3
-39
lines changed

src/graph_sitter/cli/mcp/server.py

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
from mcp.server.fastmcp import Context, FastMCP
44

5-
from graph_sitter.cli.api.client import RestAPI
6-
from graph_sitter.cli.mcp.agent.docs_expert import create_sdk_expert_agent
75
from graph_sitter.cli.mcp.resources.system_prompt import SYSTEM_PROMPT
86
from graph_sitter.cli.mcp.resources.system_setup_instructions import SETUP_INSTRUCTIONS
9-
from graph_sitter.core.codebase import Codebase
10-
from graph_sitter.shared.enums.programming_language import ProgrammingLanguage
117

128
# Initialize FastMCP server
139

@@ -41,51 +37,19 @@ def get_service_config() -> dict[str, Any]:
4137
# ----- TOOLS -----
4238

4339

44-
@mcp.tool()
45-
def ask_codegen_sdk(query: Annotated[str, "Ask a question to an exper agent for details about any aspect of the codegen sdk core set of classes and utilities"]):
46-
codebase = Codebase("../../sdk/core")
47-
agent = create_sdk_expert_agent(codebase=codebase)
48-
49-
result = agent.invoke(
50-
{"input": query},
51-
config={"configurable": {"thread_id": 1}},
52-
)
53-
54-
return result["messages"][-1].content
55-
56-
5740
@mcp.tool()
5841
def generate_codemod(
5942
title: Annotated[str, "The title of the codemod (hyphenated)"],
60-
task: Annotated[str, "The task to which the codemod should implement to solve"],
6143
codebase_path: Annotated[str, "The absolute path to the codebase directory"],
6244
ctx: Context,
6345
) -> str:
6446
"""Generate a codemod for the given task and codebase."""
65-
return f'''
47+
return f"""
6648
Use the graph_sitter.cli to generate a codemod. If you need to intall the cli the command to do so is `uv tool install graph-sitter`.
6749
Once installed, run the following command to generate the codemod:
6850
69-
gs create {title} -d "{task}"
70-
'''
71-
72-
73-
@mcp.tool()
74-
def improve_codemod(
75-
codemod_source: Annotated[str, "The source code of the codemod to improve"],
76-
task: Annotated[str, "The task to which the codemod should implement to solve"],
77-
concerns: Annotated[list[str], "A list of issues that were discovered with the current codemod that need to be considered in the next iteration"],
78-
context: Annotated[dict[str, Any], "Additional context for the codemod this can be a list of files that are related, additional information about the task, etc."],
79-
language: Annotated[ProgrammingLanguage, "The language of the codebase, i.e ALL CAPS PYTHON or TYPESCRIPT "],
80-
ctx: Context,
81-
) -> str:
82-
"""Improve the codemod."""
83-
try:
84-
client = RestAPI()
85-
response = client.improve_codemod(codemod_source, task, concerns, context, language)
86-
return response.codemod_source
87-
except Exception as e:
88-
return f"Error: {e}"
51+
gs create {title}"
52+
"""
8953

9054

9155
if __name__ == "__main__":

0 commit comments

Comments
 (0)