This example MCP server demonstrates how to create a custom MCP Server and add your own tools using the MCP protocol.
To use this example, you'll need a TMDB API access token. The server connects to The Movie Database (TMDB) to fetch detailed actor and movie information. Make sure you have a valid TMDB API token ready, as it is required for the server to function properly.
This MCP server provides two simple tools for interacting with The Movie Database (TMDB):
-
get_actor_info:
Allows you to search for an actor by name and retrieve detailed information such as their biography, date and place of birth and more. -
get_movies_by_actor:
Allows you to retrieve a list of movies associated with a particular actor by providing their TMDB ID.
This project is written in Rust and uses the rust-mcp-sdk library.
Cargo, Rust’s package manager and build tool, is required to build and run the project.
-
Windows/Mac/Linux:
Visit https://rustup.rs/ and follow the instructions to download and run the installer. -
After installation, restart your terminal and check that Rust and Cargo are installed:
rustc --version cargo --version
- Sign up for a free account at TMDB.
- Go to your account settings → API → Request an API key.
- Once you have your API key (token), keep it handy for the next step.
-
Clone or Download the Repository
If you have Git:
git clone https://github.com/theREDspace/mcp-server-example.git cd mcp-server-example/techshare-mcpOr, download the ZIP from GitHub and extract it, then open a terminal in the
techshare-mcpfolder. -
Build the Project
In the
techshare-mcpdirectory, run:cargo build --releaseThis will download dependencies and compile the project.
The compiled binary will be intarget/release/techshare-mcp.
- Install and launch MCP Inspector by running:
npx -y @modelcontextprotocol/inspector@latest
- MCP Inspector will be opened in the browser.
- Select
STDIOas "Transport Type" and enter the compiled binary path in the "Command" text box. - Set the
TMDB_TOKENenvironment variable in the "Environment Variables" section. - Click "Connect".
- Once connected, you will see the available tools and can invoke them as needed.
-
Missing TMDB Token:
If you see an error aboutTMDB_TOKEN must be set in environment, make sure you set the environment variable before running the server. -
Build Errors:
Ensure Rust and Cargo are installed and up to date. Runrustup updateif needed. -
Cannot Connect from MCP Inspector/Cloud Desktop:
Double-check the path to the binary.
src/main.rs— Entry point, sets up the server.src/mcp_handler.rs— Handles incoming MCP requests.src/tools/— Contains the tool definitions, and uses thetmdb_client.src/tmdb_client.rs— Communicates with TMDB API.
This project is for educational and demonstration purposes.