About Generic MCP Server
Generic MCP Server is a TypeScript and Express reference server for developers exposing APIs to AI agents. Its movie database integration provides tools for searching industry professionals and discovering films, with SSE communication and an example client.
Key features
- 01SSE-based MCP communication
- 02Search film industry professionals
- 03Discover films with filters
- 04Typed API response interfaces
- 05Example client for testing
Use cases
- 01Find actors or directors and their filmographies
- 02Discover films by cast, genre, or release date
- 03Test an MCP server using the included client
MCP support
The server exposes movie-search and film-discovery tools, greeting and user resources, and prompt templates to MCP clients over SSE. An example client demonstrates connecting and invoking these components.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEGeneric MCP Server
A production-ready Model Context Protocol (MCP) server implementation built with TypeScript and Express, designed to seamlessly connect AI agents with external APIs.
Overview
This project demonstrates how to implement a Server-Sent Events (SSE) MCP server using the @modelcontextprotocol/sdk. It provides developers with a practical reference for exposing APIs to AI agents and Large Language Models (LLMs) with a focus on movie database interactions.
The implementation details can be found in src/mcp/tools.ts, src/mcp/prompts.ts, src/helpers/ directory, and related files.
What is MCP?
The Model Context Protocol (MCP) establishes a standardized interface for AI models to interact with external systems securely and efficiently. It defines a structured framework for:
- Resources: Data objects that models can access
- Tools: Executable functions that models can invoke
- Prompts: Templates that guide model interactions
This standardization simplifies the integration of AI capabilities into existing applications and services.
For comprehensive documentation, visit the Model Context Protocol repository.
Key Features
- Full implementation of the MCP specification
- Real-time communication via Server-Sent Events (SSE)
- Modular architecture for easy extension
- Built-in movie database integration for searching people and discovering films
- Type-safe interfaces for API responses
- Comprehensive error handling
- Example client for testing and reference
Prerequisites
- Node.js 18 or higher
- npm or yarn package manager
Getting Started
Installation
-
Clone the repository:
git clone https://github.com/yourusername/generic-mcp-server.git cd generic-mcp-server -
Install dependencies:
npm install -
Configure your environment:
cp .env.example .env -
Add your API credentials to the
.envfile:PORT=8089 ACCESS_TOKEN=your_movie_db_access_token
Running the Server
Development mode with hot reloading:
npm run dev
Production mode:
npm run build
npm start
The server will be available at http://localhost:8089 (or the port specified in your .env file).
API Reference
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/sse | GET | Server-Sent Events endpoint for MCP communication |
/messages | POST | Endpoint for clients to send messages to the MCP server |
MCP Components
Resources
greeting://welcome: Static welcome messageusers://{userId}: Dynamic user data resource
Tools
The server implements powerful movie database tools:
- movie_database_search_person: Search for actors, directors, and film professionals with detailed information about their careers, biographical data, and filmographies.
- movie_database_discover_films: Advanced film discovery with filtering by cast, genres, release dates, ratings, and more.
Prompts
greeting: Friendly user greetinghelp: Detailed command assistanceask-question: Question template for guiding conversationserror: Graceful error handling prompt
Movie Database Features
The server provides access to The Movie Database (TMDB) API with the following capabilities:
- Search for film industry professionals including actors and directors
- Discover movies with extensive filtering options:
- By release date, popularity, or rating
- By cast or crew members
- By genres, keywords, or companies
- By runtime or language
- By monetization type (free, subscription, rental, etc.)
Environment Configuration
| Variable | Description | Default |
|---|---|---|
PORT | Server port number | 8089 |
ACCESS_TOKEN | Authentication token for movie database API | required |
Testing with the Example Client
The repository includes a demonstration client that shows how to connect to and interact with the MCP server:
npm run client
The client will:
- Establish a connection to the server
- Display available resources, tools, and prompts
- Read the greeting resource
- Demonstrate tool usage
- Retrieve prompt templates
Integrating with AI Models
This server can be integrated with any LLM that supports the MCP protocol. The standardized interface ensures compatibility with various AI frameworks and platforms.
Architecture
The project follows a modular architecture:
src/mcp/: Core MCP protocol implementationssrc/helpers/: API-specific helper functionssrc/utils/: Utility functions and shared codesrc/types.ts: TypeScript interface definitions
Available Interfaces
The project includes typed interfaces for API responses:
ApiResponse<T>: Generic API response wrapper with data, error, and status fieldsApiConfig: Configuration for API client with baseUrl and optional headers
These interfaces help ensure type safety when working with API data.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.