Skip to main content
Glama
README.md
::: {align="center"}
# πŸš€ Nexus MCP

### A Modular Model Context Protocol Server for Developer Tools & Data Science

[![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/)
[![MCP](https://img.shields.io/badge/Protocol-MCP-6C5CE7)](https://modelcontextprotocol.io/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Tests](https://img.shields.io/badge/Tests-8%20passing-brightgreen)](#testing)
[![Status](https://img.shields.io/badge/Status-Active%20Development-orange)](#roadmap)

**One MCP server. Multiple practical capabilities.**

Nexus MCP brings together secure workspace operations, Git insights,
system information, public text retrieval, and data-science workflows in
a modular Python project designed to be extended and connected to
MCP-compatible AI clients.
:::

------------------------------------------------------------------------

## πŸ“Œ Overview

Nexus MCP is a modular Python implementation of the **Model Context
Protocol (MCP)**. It exposes developer utilities and data-science
operations as tools, resources, and prompts so an MCP-compatible client
can interact with a project workspace and supported workflows.

The project focuses on:

-   **Modularity** --- separate tool modules and service-layer logic.
-   **Practical developer workflows** --- workspace, Git, and system
    utilities.
-   **Data science support** --- CSV profiling, EDA, correlations,
    outlier detection, and cleaning previews.
-   **Safer defaults** --- workspace sandboxing, opt-in write/fetch
    capabilities, and read-only Git tools.
-   **Testability** --- service and security tests.

> Nexus MCP is an actively developed portfolio project. Review the
> security notes before exposing it to untrusted users or networks.

## ✨ Features

  -----------------------------------------------------------------------
  Module                              Capabilities
  ----------------------------------- -----------------------------------
  πŸ“ Workspace                        List files, read files, search
                                      workspace content, optionally write
                                      files

  πŸ–₯️ System                           System information and workspace
                                      summary

  🌿 Git                              Repository status, recent commits,
                                      and diffs

  πŸ“Š Data Science                     CSV profile, numeric summary,
                                      automated EDA, correlation
                                      analysis, outlier detection,
                                      cleaning preview

  🌐 Web                              Fetch public text over HTTPS when
                                      explicitly enabled

  🧩 MCP                              Tools, resources, and reusable
                                      prompts
  -----------------------------------------------------------------------

### Data Science toolkit

  -----------------------------------------------------------------------
  Tool                                What it does
  ----------------------------------- -----------------------------------
  `csv_profile`                       Reports dataset dimensions, column
                                      types, missing values, uniqueness,
                                      and sample rows

  `csv_numeric_summary`               Summarizes numeric columns with
                                      descriptive statistics

  `automated_eda`                     Combines dataset profiling with
                                      numeric/categorical summaries and
                                      quality recommendations

  `correlation_analysis`              Calculates Pearson, Spearman, or
                                      Kendall correlations for numeric
                                      columns

  `detect_dataset_outliers`           Flags potential outliers using IQR
                                      or Z-score methods

  `clean_dataset`                     Previews missing-value handling and
                                      duplicate removal without
                                      overwriting the original CSV
  -----------------------------------------------------------------------

**Cleaning strategies:** `none`, `drop_rows`, `median`, `mean`, and
`mode`.

**Outlier methods:** `IQR` and `Z-score`.

The cleaning workflow returns a preview and summary; it does not
silently replace the source dataset.

## πŸ—οΈ Architecture

``` mermaid
flowchart TB
    Client["MCP Client<br/>(Inspector / compatible AI app)"]
    Server["Nexus MCP Server"]
    Registry["Tool / Resource / Prompt Registration"]

    Client <-->|"MCP over stdio"| Server
    Server --> Registry

    Registry --> FS["Workspace Tools"]
    Registry --> SYS["System Tools"]
    Registry --> GIT["Git Tools"]
    Registry --> DS["Data Science Tools"]
    Registry --> WEB["Public Text Fetch Tool"]
    Registry --> RES["MCP Resources"]
    Registry --> PROMPT["MCP Prompts"]

    DS --> SERVICES["Data Science Service Layer"]
    SERVICES --> IO["CSV I/O"]
    SERVICES --> PROFILE["Profiling"]
    SERVICES --> CORR["Correlation"]
    SERVICES --> OUT["Outlier Detection"]
    SERVICES --> CLEAN["Cleaning"]
```

### Data science request flow

``` mermaid
flowchart LR
    A["CSV in workspace"] --> B["Validate workspace path"]
    B --> C["Load dataset"]
    C --> D["Run selected analysis"]
    D --> E["Return structured result"]
    E --> F["Client displays insights"]
```

## 🧰 Technology Stack

-   **Language:** Python
-   **Protocol:** Model Context Protocol (MCP)
-   **Data processing:** pandas, NumPy
-   **Validation/configuration:** Pydantic, pydantic-settings
-   **HTTP client:** httpx
-   **Testing:** pytest
-   **Code quality:** Ruff and mypy configuration
-   **Packaging:** `pyproject.toml`

## πŸ“‚ Project Structure

``` text
nexus-mcp/
β”œβ”€β”€ src/
β”‚   └── nexus_mcp/
β”‚       β”œβ”€β”€ server.py
β”‚       β”œβ”€β”€ logging_config.py
β”‚       β”œβ”€β”€ prompts.py
β”‚       β”œβ”€β”€ resources.py
β”‚       β”œβ”€β”€ security.py
β”‚       β”œβ”€β”€ tools/
β”‚       β”‚   β”œβ”€β”€ filesystem.py
β”‚       β”‚   β”œβ”€β”€ system.py
β”‚       β”‚   β”œβ”€β”€ git.py
β”‚       β”‚   β”œβ”€β”€ data_science.py
β”‚       β”‚   └── web.py
β”‚       └── services/
β”‚           └── data_science/
β”‚               β”œβ”€β”€ io.py
β”‚               β”œβ”€β”€ profiling.py
β”‚               β”œβ”€β”€ correlation.py
β”‚               β”œβ”€β”€ outliers.py
β”‚               └── cleaning.py
β”œβ”€β”€ tests/
β”œβ”€β”€ examples/
β”œβ”€β”€ workspace/
β”œβ”€β”€ .github/workflows/
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ uv.lock
└── README.md
```

## βš™οΈ Installation

### 1. Clone the repository

``` bash
git clone https://github.com/RAUNAK-RAJ19/Basic-mcp-server.git
cd Basic-mcp-server
```

### 2. Create and activate a virtual environment

**Windows PowerShell**

``` powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
```

**macOS / Linux**

``` bash
python -m venv .venv
source .venv/bin/activate
```

### 3. Install the project

Install the project with development and data-science dependencies:

``` bash
python -m pip install --upgrade pip
pip install -e ".[dev,data]"
```

If you use `uv`, you can install from the lockfile:

``` bash
uv sync --all-extras
```

## ▢️ Run the server

Start the MCP server:

``` bash
mcp run src/nexus_mcp/server.py
```

If your project entry point is configured through the root `server.py`,
you can also run:

``` bash
mcp dev server.py
```

The development command opens **MCP Inspector**, allowing you to connect
to the server and inspect its tools, resources, and prompts.

> Run the command that matches the entry point in your local checkout.
> The Inspector development command is intended for local development
> and testing.

## πŸ§ͺ Example workflow

Place a CSV file inside the `workspace/` directory. For example, use
`examples/sample.csv` and copy it into the workspace:

``` powershell
Copy-Item examples/sample.csv workspace/sample.csv
```

Then call the tools from MCP Inspector or your connected MCP client:

1.  `workspace_list` --- confirm that `sample.csv` is available.
2.  `csv_profile` --- inspect dimensions, data types, and missing
    values.
3.  `automated_eda` --- get a broader exploratory summary.
4.  `correlation_analysis` --- inspect relationships between numeric
    columns.
5.  `detect_dataset_outliers` --- flag potential outliers.
6.  `clean_dataset` --- preview a cleaning strategy such as median
    imputation.

Example dataset:

``` csv
name,age,score
Asha,21,88
Ravi,22,91
Mina,,84
Dev,20,91
```

For this sample, median imputation fills Mina's missing age with **21**.
The original CSV is not overwritten by the cleaning preview.

## πŸ” Security model

Nexus MCP uses safer defaults for local development:

  -----------------------------------------------------------------------
  Control                             Default / behavior
  ----------------------------------- -----------------------------------
  Workspace boundary                  File operations are restricted to
                                      the configured workspace

  File writes                         Disabled unless explicitly enabled

  HTTP fetch                          Disabled unless explicitly enabled

  Web requests                        HTTPS-only; private-address targets
                                      are rejected; redirects are
                                      disabled

  Git operations                      Read-only commands, without shell
                                      execution

  Command execution                   No general-purpose arbitrary
                                      terminal command tool
  -----------------------------------------------------------------------

### Optional environment settings

Create a local `.env` file only if you need to change these settings.
Never commit secrets or local environment files.

``` env
NEXUS_ALLOW_FILE_WRITES=false
NEXUS_ALLOW_HTTP_FETCH=false
```

To enable a capability for a trusted local workflow, set its value to
`true` and restart the server. Understand the risks before enabling it.

**Security disclaimer:** These controls are not a substitute for a
security audit. Do not expose the server to untrusted users or public
networks without additional authentication, authorization, isolation,
and deployment hardening.

## πŸ§ͺ Testing

Run the test suite from the project root:

``` bash
pytest -q
```

Run with coverage:

``` bash
pytest --cov=nexus_mcp --cov-report=term-missing
```

The project test suite covers data-science services, security behavior,
and tool functionality.

## πŸ”Œ MCP capabilities

The current implementation registers **16 tools**, **2 resources**, and
**2 prompts**.

```{=html}
<details>
```
```{=html}
<summary>
```
`<strong>`{=html}View the tool inventory`</strong>`{=html}
```{=html}
</summary>
```
  -----------------------------------------------------------------------
  Category                            Tools
  ----------------------------------- -----------------------------------
  Workspace                           `workspace_list`,
                                      `workspace_read_file`,
                                      `workspace_write_file`,
                                      `workspace_search`

  System                              `system_information`,
                                      `workspace_summary`

  Git                                 `git_status`, `git_recent_commits`,
                                      `git_diff`

  Data Science                        `csv_profile`,
                                      `csv_numeric_summary`,
                                      `automated_eda`,
                                      `correlation_analysis`,
                                      `detect_dataset_outliers`,
                                      `clean_dataset`

  Web                                 `fetch_public_text`
  -----------------------------------------------------------------------

**Resources** - `nexus://server/info` - `nexus://workspace/guide`

**Prompts** - `code_review` - `dataset_analysis`

```{=html}
</details>
```
## πŸ—ΊοΈ Roadmap

-   [x] Modular MCP server structure
-   [x] Workspace and system tools
-   [x] Read-only Git integration
-   [x] CSV profiling and automated EDA
-   [x] Correlation and outlier analysis
-   [x] Safe cleaning preview
-   [x] Security and service tests
-   [ ] Machine-learning training and evaluation tools
-   [ ] Model persistence and prediction workflows
-   [ ] Expanded integration examples
-   [ ] Additional deployment and observability options

## 🀝 Contributing

Contributions, bug reports, and feature suggestions are welcome.

1.  Fork the repository.
2.  Create a feature branch.
3.  Add or update tests.
4.  Run `pytest -q`.
5.  Open a pull request describing the change.

## πŸ‘¨β€πŸ’» Author

**Raunak Raj**

-   GitHub: [@RAUNAK-RAJ19](https://github.com/RAUNAK-RAJ19)

If you find this project useful, consider giving the repository a ⭐.

------------------------------------------------------------------------

::: {align="center"}
**Built to make practical AI-agent workflows easier to compose.**
:::