Skip to main content
Glama
Praniti1594

AI Developer Workspace MCP Server

by Praniti1594
README.md
# AI Developer Workspace — MCP Project

An AI-powered developer workspace built using the **Model Context Protocol (MCP)**. The project allows developers to inspect and modify a local software project through a web interface and an AI coding agent.

The system combines **FastMCP, FastAPI, Groq, Git, and a browser-based frontend** to create a lightweight AI development assistant.

## šŸš€ Overview

AI Developer Workspace acts as a mini AI coding assistant that can understand a developer's request and perform project-level operations through MCP tools.

Instead of manually navigating through project files, developers can use the workspace to:

* View project files
* Read source files
* Search project files
* Create new files
* Update existing files
* Delete files
* Check Git status
* View recent Git commits
* Generate a project summary
* Ask an AI agent to perform development tasks

The AI agent uses MCP tools to interact with the project rather than directly modifying files.

## ✨ Features

### šŸ“ Project File Management

The workspace provides tools for:

* Listing project files
* Reading files
* Searching files by keyword
* Creating files
* Updating existing files
* Deleting files

### šŸ¤– AI Developer Agent

The AI agent accepts natural-language development requests such as:

> Create calculator.py with add, subtract, multiply and divide functions.

or:

> Update calculator.py to add power and modulus functions while preserving the existing functionality.

The agent determines whether it needs to create or update a file and invokes the appropriate MCP tool.

### šŸ”Œ Model Context Protocol

The project uses **FastMCP** to expose developer operations as MCP tools.

The AI agent communicates with the MCP server using the MCP client.

Example architecture:

```text
User
  │
  ā–¼
Web Frontend
  │
  │ HTTP
  ā–¼
FastAPI Backend
  │
  ā”œā”€ā”€ Project APIs
  │
  └── AI Agent
        │
        │ Groq LLM
        ā–¼
      Tool Calling
        │
        ā–¼
     MCP Client
        │
        ā–¼
     FastMCP Server
        │
        ā”œā”€ā”€ create_file
        ā”œā”€ā”€ update_file
        ā”œā”€ā”€ read_file
        ā”œā”€ā”€ delete_file
        ā”œā”€ā”€ search_files
        └── Git operations
```

### 🌿 Git Integration

The workspace can inspect the project's Git repository and expose information such as:

* Current Git status
* Modified files
* Recent commits
* Commit information

### šŸ“Š Project Summary

The application can generate a project-level summary containing information about the project and recent development activity.

### 🌐 Web Interface

A lightweight browser frontend provides an interface for interacting with the backend.

The frontend communicates with the FastAPI server using HTTP requests.

## šŸ› ļø Technology Stack

| Technology    | Purpose                        |
| ------------- | ------------------------------ |
| Python        | Backend and MCP implementation |
| FastMCP       | MCP server                     |
| MCP Client    | Communication with MCP server  |
| FastAPI       | REST API backend               |
| Groq          | LLM-powered AI agent           |
| JavaScript    | Frontend logic                 |
| HTML/CSS      | Frontend UI                    |
| Git           | Version control                |
| python-dotenv | Environment configuration      |

## šŸ“‚ Project Structure

```text
mini-devpilot/
│
ā”œā”€ā”€ server.py
│
ā”œā”€ā”€ demo_client/
│   ā”œā”€ā”€ index.html
│   ā”œā”€ā”€ app.js
│   └── style.css
│
ā”œā”€ā”€ .env
ā”œā”€ā”€ requirements.txt
│
└── project files/
```

> The exact structure may vary depending on the current development version.

## āš™ļø Setup

### 1. Clone the repository

```bash
git clone https://github.com/Praniti1594/MCP-project-ai-developer-workspace.git
cd MCP-project-ai-developer-workspace
```

### 2. Create a virtual environment

Windows:

```powershell
python -m venv .venv
```

Activate it:

```powershell
.\.venv\Scripts\Activate.ps1
```

### 3. Install dependencies

```powershell
pip install -r requirements.txt
```

### 4. Configure environment variables

Create a `.env` file:

```env
GROQ_API_KEY=your_groq_api_key
GROQ_MODEL=llama-3.3-70b-versatile
```

Never commit your `.env` file or API keys to GitHub.

## ā–¶ļø Running the Backend

From the project root:

```powershell
python server.py
```

The backend runs on:

```text
http://127.0.0.1:9000
```

## ā–¶ļø Running the Frontend

Open another terminal:

```powershell
cd demo_client
python -m http.server 5500
```

Then open:

```text
http://127.0.0.1:5500
```

The frontend communicates with the backend at:

```text
http://127.0.0.1:9000
```

## šŸ”§ Example AI Requests

### Create a file

```text
Create calculator.py with functions for addition, subtraction,
multiplication and division.
```

### Update a file

```text
Update calculator.py to add power and modulus functions while
preserving all existing functionality.
```

### Project inspection

```text
Show me the project files.
```

```text
Search the project for the word "stack".
```

```text
Read dsa.py.
```

## šŸ”— API Endpoints

The backend exposes endpoints for common developer workspace operations.

| Endpoint          | Purpose                                  |
| ----------------- | ---------------------------------------- |
| `/files`          | List project files                       |
| `/git-status`     | View Git status                          |
| `/recent-commits` | View recent commits                      |
| `/summary`        | Generate project summary                 |
| `/search`         | Search project files                     |
| `/read-file`      | Read a project file                      |
| `/delete-file`    | Delete a project file                    |
| `/agent`          | Send a request to the AI developer agent |

## 🧠 AI Agent Workflow

When the user sends a development request:

```text
User Request
     │
     ā–¼
AI Agent
     │
     ā”œā”€ā”€ Create new file?
     │       │
     │       └── create_file
     │
     └── Modify existing file?
             │
             ā”œā”€ā”€ Read existing file
             │
             └── update_file
```

For updates, the agent retrieves the existing file contents before generating the updated version. This helps preserve existing functionality instead of blindly replacing a file.

## šŸ” Security Considerations

* API keys are stored in environment variables.
* `.env` should not be committed to Git.
* File operations should be restricted to the intended project workspace.
* The MCP server should not be exposed publicly without appropriate authentication and access controls.

## šŸŽÆ Project Goals

This project was created to explore how **Model Context Protocol can be used to build AI-powered developer tools**.

The main goals are:

1. Understand MCP server and client architecture.
2. Build practical developer tools using MCP.
3. Connect an LLM to MCP tools through function/tool calling.
4. Allow an AI agent to interact with real project files.
5. Integrate Git information into an AI developer workspace.
6. Build a usable browser-based developer interface.

## šŸ”® Future Improvements

Potential improvements include:

* Streaming AI responses
* Webhooks and event handlers
* Better error handling
* Authentication and authorization
* File-diff previews before applying changes
* Undo/rollback for file modifications
* Git commit creation through the AI agent
* Automated tests
* Code validation before writing files
* Syntax checking after AI-generated changes
* Improved MCP tool discovery
* Better frontend error handling
* Agent execution history
* Tool-call logging and monitoring

## šŸ“š What This Project Demonstrates

This project demonstrates practical experience with:

* Model Context Protocol (MCP)
* MCP tool design
* FastMCP
* AI tool calling
* LLM agents
* FastAPI
* REST APIs
* Asynchronous Python
* Git integration
* Frontend/backend communication
* Environment configuration
* AI-assisted software development

## šŸ‘©ā€šŸ’» Author

**Praniti Kubal**

GitHub:

https://github.com/Praniti1594