Skip to main content
The Basic TypeScript server demonstrates core MCP capabilities including tools, resources, and prompts. It features Game of Thrones quote fetching, mathematical operations, and code review functionality.

Features

  • Tools: Random quotes, LCM calculator
  • Resources: Dynamic quote retrieval and person data
  • Prompts: Quote analysis and code review templates
  • API Integration: Game of Thrones Quotes API

Installation

1

Clone and Navigate

Navigate to the basic server directory:
2

Install Dependencies

Install required packages:
3

Build the Server

Compile TypeScript to JavaScript:
4

Configure MCP Client

Add to your MCP client configuration:

Tools

get_random_quotes

Fetch random quotes from Game of Thrones characters. Parameters:
  • count (number, optional): Number of quotes to fetch (1-10, default: 5)
Example Usage:
Response:
Implementation:

lcm

Calculate the least common multiple of a list of numbers. Parameters:
  • numbers (array of numbers): At least 2 numbers required
Example Usage:
Response:
Implementation:

Resources

Random Quotes Resource

Access random Game of Thrones quotes via URI. URI: got://quotes/random Implementation:

Person Properties Resource

Dynamic resource template for accessing person data. URI Template: person://properties/{name} Available Names:
  • alexys
  • mariana
Example URI: person://properties/alexys Response:
Implementation:

Prompts

Game of Thrones Quotes Analysis

Generate a prompt for analyzing GoT quotes with optional theme focus. Name: got_quotes_analysis Parameters:
  • theme (string, optional): Focus theme for analysis
Example:
Implementation:

Code Review Prompt

Structured code review template with best practices focus. Name: code_review Parameters:
  • code (string, required): Code to review
Implementation:

API Integration

The server integrates with the Game of Thrones Quotes API: Base URL: https://api.gameofthronesquotes.xyz/v1 Fetch Random Quotes:

Server Configuration

Server Initialization:

Dependencies

Troubleshooting

Ensure you have Node.js 16+ installed:
Clear build artifacts and rebuild:
The server requires internet access to fetch quotes from the Game of Thrones API. Check your network connection and firewall settings.
Verify your TypeScript configuration in tsconfig.json:

Project Structure

Next Steps

Todo Server

Learn about building CRUD operations with the Todo TypeScript server

Calculator Server

Explore Python MCP servers with FastMCP