Skip to main content
Glama
mohanaprasanthk

Movie Search MCP Server

README.md
# ๐ŸŽฌ Movie Search MCP Server

A simple **Model Context Protocol (MCP)** server built with the official MCP TypeScript SDK.

This project demonstrates how to create a custom MCP server, register tools, validate input using Zod, and test everything using the MCP Inspector.

---

## ๐Ÿš€ Features

- Search movies by title
- JSON-based movie database
- Input validation using Zod
- MCP Tool registration
- STDIO transport
- Tested using MCP Inspector

---

## ๐Ÿ› ๏ธ Tech Stack

- Node.js
- MCP SDK
- Zod
- JavaScript (ES Modules)
- MCP Inspector

---

## ๐Ÿ“ Project Structure

```text
movie-search-mcp-server/
โ”‚
โ”œโ”€โ”€ tools/
โ”‚   โ””โ”€โ”€ searchMovie.js
โ”œโ”€โ”€ movies.json
โ”œโ”€โ”€ server.js
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md
```

---

## ๐Ÿ“ฆ Installation

Clone the repository

```bash
git clone https://github.com/YOUR_USERNAME/movie-search-mcp-server.git
```

Go to the project

```bash
cd movie-search-mcp-server
```

Install dependencies

```bash
npm install
```

Run the server

```bash
npm start
```

---

## ๐Ÿงช Testing

Launch MCP Inspector

```bash
npx @modelcontextprotocol/inspector@latest
```

Connect using

- Transport: STDIO
- Command: node
- Arguments: server.js

---

## ๐Ÿ“Œ Example Tool

### searchMovie

Input

```json
{
  "title": "Leo"
}
```

Output

```json
{
  "found": true,
  "movie": {
    "title": "Leo",
    "year": 2023,
    "language": "Tamil",
    "hero": "Vijay"
  }
}
```

---

## ๐Ÿ“š Concepts Learned

- Model Context Protocol (MCP)
- MCP Server
- MCP Tools
- STDIO Transport
- Zod Validation
- JSON Data Handling
- MCP Inspector
- Node.js File System

---

## ๐Ÿ‘จโ€๐Ÿ’ป Author

Mohanaprasanth K