Skip to content

Commit 69d0b8a

Browse files
authored
Merge pull request #12 from WasmEdge/remove-old-mcp
Remove old mcp
2 parents 523d078 + 323123d commit 69d0b8a

File tree

8 files changed

+22
-967
lines changed

8 files changed

+22
-967
lines changed

.env

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/test-mcp-server.yml

Lines changed: 12 additions & 334 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ RUN apt-get update && apt-get install -y curl build-essential && \
99
# Add cargo to PATH
1010
ENV PATH="/root/.cargo/bin:${PATH}"
1111

12-
# Directly download and install OpenMCP from source to avoid binary compatibility issues
13-
# RUN apt-get install -y git && \
14-
# git clone https://github.com/decentralized-mcp/proxy.git && \
15-
# cd proxy && \
16-
# cargo build --release && \
17-
# cp target/release/openmcp /usr/local/bin/ && \
18-
# chmod +x /usr/local/bin/openmcp && \
19-
# cd .. && \
20-
# rm -rf proxy
21-
2212
# Install openmcp proxy via the installer
2313
RUN curl -sSfL 'https://raw.githubusercontent.com/decentralized-mcp/proxy/refs/heads/master/install.sh' | bash
2414

app/main.py

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from app.compiler import RustCompiler
1919
from app.llm_client import LlamaEdgeClient
2020
from app.vector_store import QdrantStore
21-
from app.mcp_service import RustCompilerMCP
2221

2322
app = FastAPI(title="Rust Project Generator API")
2423

@@ -118,9 +117,6 @@ async def compile_rust(request: dict):
118117
if "code" not in request:
119118
raise HTTPException(status_code=400, detail="Missing 'code' field")
120119

121-
# Remove MCP service reference
122-
# return rust_mcp.compile_rust_code(request["code"])
123-
124120
# Create temp directory
125121
with tempfile.TemporaryDirectory() as temp_dir:
126122
# Parse the multi-file content
@@ -155,35 +151,6 @@ async def compile_rust(request: dict):
155151
"error_details": error_context
156152
}
157153

158-
@app.post("/compile-and-fix")
159-
async def compile_and_fix(request: CompileAndFixRequest):
160-
"""Compile Rust code and fix errors with LLM"""
161-
code = request.code
162-
description = request.description
163-
max_attempts = request.max_attempts
164-
165-
# Create MCP service instance
166-
mcp_service = RustCompilerMCP(
167-
vector_store=get_vector_store(),
168-
llm_client=llm_client
169-
)
170-
171-
# Compile and fix code
172-
result = mcp_service.compile_and_fix_rust_code(
173-
code_content=code,
174-
description=description,
175-
max_attempts=max_attempts
176-
)
177-
178-
# Add combined_text field with the entire project in flat text format
179-
combined_text = ""
180-
for filename, content in result["final_files"].items():
181-
combined_text += f"[filename: {filename}]\n{content}\n\n"
182-
183-
result["combined_text"] = combined_text.strip()
184-
185-
return result
186-
187154
@app.post("/compile-and-fix")
188155
async def compile_and_fix_rust(request: dict):
189156
"""Endpoint to compile and fix Rust code"""
@@ -195,16 +162,9 @@ async def compile_and_fix_rust(request: dict):
195162
# Pre-process code to fix common syntax errors
196163
code = request["code"]
197164
# Fix missing parenthesis in println! macro
198-
if "println!(" in code and ");" not in code:
199-
code = code.replace("println!(\"", "println!(\"")
200-
code = code.replace("\" //", "\"); //")
201-
202-
# Remove MCP service reference
203-
# result = rust_mcp.compile_and_fix_rust_code(
204-
# code,
205-
# request["description"],
206-
# max_attempts=max_attempts
207-
# )
165+
# if "println!(" in code and ");" not in code:
166+
# code = code.replace("println!(\"", "println!(\"")
167+
# code = code.replace("\" //", "\"); //")
208168

209169
# Create temp directory
210170
with tempfile.TemporaryDirectory() as temp_dir:
@@ -722,4 +682,4 @@ async def generate_project_sync(request: ProjectRequest):
722682
return PlainTextResponse(content=all_files_content)
723683

724684
except Exception as e:
725-
raise HTTPException(status_code=500, detail=f"Error generating project: {str(e)}")
685+
raise HTTPException(status_code=500, detail=f"Error generating project: {str(e)}")

app/mcp_server.py

Lines changed: 0 additions & 205 deletions
This file was deleted.

0 commit comments

Comments
 (0)