Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .env

This file was deleted.

346 changes: 12 additions & 334 deletions .github/workflows/test-mcp-server.yml

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ RUN apt-get update && apt-get install -y curl build-essential && \
# Add cargo to PATH
ENV PATH="/root/.cargo/bin:${PATH}"

# Directly download and install OpenMCP from source to avoid binary compatibility issues
# RUN apt-get install -y git && \
# git clone https://github.com/decentralized-mcp/proxy.git && \
# cd proxy && \
# cargo build --release && \
# cp target/release/openmcp /usr/local/bin/ && \
# chmod +x /usr/local/bin/openmcp && \
# cd .. && \
# rm -rf proxy

# Install openmcp proxy via the installer
RUN curl -sSfL 'https://raw.githubusercontent.com/decentralized-mcp/proxy/refs/heads/master/install.sh' | bash

Expand Down
48 changes: 4 additions & 44 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from app.compiler import RustCompiler
from app.llm_client import LlamaEdgeClient
from app.vector_store import QdrantStore
from app.mcp_service import RustCompilerMCP

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

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

# Remove MCP service reference
# return rust_mcp.compile_rust_code(request["code"])

# Create temp directory
with tempfile.TemporaryDirectory() as temp_dir:
# Parse the multi-file content
Expand Down Expand Up @@ -155,35 +151,6 @@ async def compile_rust(request: dict):
"error_details": error_context
}

@app.post("/compile-and-fix")
async def compile_and_fix(request: CompileAndFixRequest):
"""Compile Rust code and fix errors with LLM"""
code = request.code
description = request.description
max_attempts = request.max_attempts

# Create MCP service instance
mcp_service = RustCompilerMCP(
vector_store=get_vector_store(),
llm_client=llm_client
)

# Compile and fix code
result = mcp_service.compile_and_fix_rust_code(
code_content=code,
description=description,
max_attempts=max_attempts
)

# Add combined_text field with the entire project in flat text format
combined_text = ""
for filename, content in result["final_files"].items():
combined_text += f"[filename: {filename}]\n{content}\n\n"

result["combined_text"] = combined_text.strip()

return result

@app.post("/compile-and-fix")
async def compile_and_fix_rust(request: dict):
"""Endpoint to compile and fix Rust code"""
Expand All @@ -195,16 +162,9 @@ async def compile_and_fix_rust(request: dict):
# Pre-process code to fix common syntax errors
code = request["code"]
# Fix missing parenthesis in println! macro
if "println!(" in code and ");" not in code:
code = code.replace("println!(\"", "println!(\"")
code = code.replace("\" //", "\"); //")

# Remove MCP service reference
# result = rust_mcp.compile_and_fix_rust_code(
# code,
# request["description"],
# max_attempts=max_attempts
# )
# if "println!(" in code and ");" not in code:
# code = code.replace("println!(\"", "println!(\"")
# code = code.replace("\" //", "\"); //")

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

except Exception as e:
raise HTTPException(status_code=500, detail=f"Error generating project: {str(e)}")
raise HTTPException(status_code=500, detail=f"Error generating project: {str(e)}")
205 changes: 0 additions & 205 deletions app/mcp_server.py

This file was deleted.

Loading