MCP ExplorerExplorer

Fastmcp Boilerplate

@punkpeyeon a year ago
26 MIT
FreeCommunity
AI Systems
#boilerplate#fastmcp#mcp
A repo showing a simple MCP server built using FastMCP.

Overview

What is Fastmcp Boilerplate

FastMCP Boilerplate is a starter template designed for building a Minecraft Protocol (MCP) server using the FastMCP framework. It provides an organized structure and configuration to facilitate development and streamline workflows, making it easier for developers to create and maintain their MCP server projects.

Use cases

This boilerplate is suited for developers looking to create custom Minecraft server tools, implement new functionalities, or experiment with server-side scripting. It serves as a foundational setup for projects requiring interaction with Minecraft’s protocol, allowing for extensibility and customization.

How to use

To get started, clone the FastMCP Boilerplate repository, install the necessary dependencies via npm, and use the provided scripts to run the server, conduct tests, perform linting, and format the code. Use ‘npm run dev’ for an interactive development experience or ‘npm run start’ for a simple server launch.

Key features

Notable features include a pre-configured testing framework, linting with Prettier and ESLint for code quality, automated formatting, and integration with GitHub Actions for CI/CD. It also supports publishing to NPM through semantic-release, ensuring a smooth workflow for versioning and releases.

Where to use

FastMCP Boilerplate can be used in any Minecraft server development context where a custom MCP server is desired. It is beneficial for both individual developers and teams collaborating on Minecraft server tools, allowing for rapid development and deployment of custom solutions.

Content

FastMCP Boilerplate

A boilerplate for FastMCP.

This boilerplate is a good starting point for building an MCP server. It includes a basic setup for testing, linting, formatting, and publishing to NPM.

Development

To get started, clone the repository and install the dependencies.

git clone https://github.com/punkpeye/fastmcp-boilerplate.git
cd fastmcp-boilerplate
npm install
npm run dev

[!NOTE]
If you are starting a new project, you may want to fork fastmcp-boilerplate and start from there.

Start the server

If you simply want to start the server, you can use the start script.

npm run start

However, you can also interact with the server using the dev script.

npm run dev

This will start the server and allow you to interact with it using CLI.

Testing

A good MCP server should have tests. However, you don’t need to test the MCP server itself, but rather the tools you implement.

npm run test

In the case of this boilerplate, we only test the implementation of the add tool.

Linting

Having a good linting setup reduces the friction for other developers to contribute to your project.

npm run lint

This boilerplate uses Prettier, ESLint and TypeScript ESLint to lint the code.

Formatting

Use npm run format to format the code.

npm run format

GitHub Actions

This repository has a GitHub Actions workflow that runs linting, formatting, tests, and publishes package updates to NPM using semantic-release.

In order to use this workflow, you need to:

  1. Add NPM_TOKEN to the repository secrets
    1. Create a new automation token
    2. Add token as NPM_TOKEN environment secret (Settings → Secrets and Variables → Actions → “Manage environment secrets” → “release” → Add environment secret)
  2. Grant write access to the workflow (Settings → Actions → General → Workflow permissions → “Read and write permissions”)

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers