Skip to main content
Glama
README.md
# MCP Utils Server

An **experimental Model Context Protocol (MCP) server** providing a collection of utility tools and resources, including calculator operations, GitHub repository fetching, a movie database resource, and JavaScript code review capabilities.

This project was built as a **learning-first MCP server** and is compatible with MCP clients such as **Cursor**, **Claude Desktop**, and other MCP-enabled tools.

---

## ✨ Features

- 🧮 **Calculator tools** (basic arithmetic operations)
- šŸ™ **GitHub integration** – fetch public repositories by username
- šŸŽ¬ **Movies resource** – access a JSON database of modern movies
- šŸ§‘ā€šŸ’» **Code review prompt** – review JavaScript / TypeScript code
- šŸ“¦ Written in **TypeScript** with schema validation using **Zod**
- šŸ”Œ Uses **stdio transport**, as required by MCP

---

## šŸ“¦ Prerequisites

Before you begin, ensure you have the following installed:

- **Node.js** (v16 or higher)
- **npm** or **yarn**

## šŸš€ Installation

1. Clone the repository:
```bash
git clone https://github.com/kh-mahmoud/experimental-mcp.git
cd experimental-mcp
```

2. Install dependencies:
```bash
npm install
```

3. Build the project:
```bash
npm run build
```

This will compile TypeScript files from `src/` to JavaScript in the `build/` directory.

Run the following command from the project root to test and debug the MCP server locally using the **MCP Inspector** :

```bash
npx -y @modelcontextprotocol/inspector tsx src/index.ts
```

## šŸ’» Usage

### As an MCP Server

This server is designed to be used with MCP-compatible clients (like Cursor, Claude Desktop, etc.).

The server exposes itself as `utils` and runs via stdio transport.

### Running the Server

After building, you can run the server:

```bash
node build/index.js
```

Or use the binary (after building):

```bash
./build/index.js
```

### MCP Client Configuration

To use this server with an MCP client, add it to your client's configuration file:

```json
{
  "mcpServers": {
    "utils": {
      "command": "node",
      "args": ["/path/to/first-mcp/build/index.js"]
    }
  }
}
```

## šŸ›  Available Tools

### Calculator Operations



### GitHub - Get Repositories

Fetches all public repositories for a given GitHub username.


### Movies Resource


Provides access to a JSON database of recent modern movies with details including:
- Title
- Year
- Genre
- Director
- Description


### Code Review Prompt


Reviews JavaScript/TypeScript code against JavaScript Standard Style best practices.


## šŸ“ Project Structure

```
first-mcp/
ā”œā”€ā”€ src/                    # TypeScript source files
│   ā”œā”€ā”€ data/              # Data files (movies.json, rules.md)
│   ā”œā”€ā”€ logic/             # Business logic
│   ā”œā”€ā”€ tools/             # MCP tools implementation
│   │   ā”œā”€ā”€ calculator/    # Calculator tools
│   │   ā”œā”€ā”€ github/        # GitHub integration
│   │   ā”œā”€ā”€ prompts/       # Code review prompts
│   │   └── ressource/     # Resources (movies)
│   └── index.ts           # Server entry point
ā”œā”€ā”€ build/                 # Compiled JavaScript (generated)
ā”œā”€ā”€ package.json           # Project dependencies
ā”œā”€ā”€ tsconfig.json          # TypeScript configuration
└── README.md             # This file
```


## šŸ“ Notes

- The server uses **TypeScript** with strict type checking
- All tools use **Zod** for schema validation
- The server communicates via **stdio transport** (standard input/output)
- Resources are served as JSON with proper MIME types


## šŸ”— Related Links

- [Model Context Protocol](https://modelcontextprotocol.io/)
- [MCP SDK Documentation](https://github.com/modelcontextprotocol/typescript-sdk)