Building an MCP Server: The Project Generator
~12 min read
mcp-use includes a project generator (create-mcp-use-app) that scaffolds a ready-to-use server with example tools, prompts, resources, and built-in MCP Inspector support.
Having covered the agent/client side of mcp-use, this topic turns to the other half: building the SERVER that exposes capabilities in the first place. Agents and clients decide how to act, but MCP servers are what make those actions possible — a server is the source of truth for capabilities: tools to execute, resources to read, prompts to supply, and structured interactions like sampling or elicitation. Once a server exposes these capabilities, any standard MCP client can discover and use them.
mcp-use provides a lightweight framework for defining these capabilities declaratively, making it easier to build servers that integrate cleanly with MCP agents. Note: this course's own worked examples for this specific mcp-use server-building section are written in TypeScript (mcp-use's server tooling is primarily a TypeScript/Node.js-oriented workflow) — this subtopic's code example below translates the same declarative shape into Python using the equivalent official MCP Python SDK pattern, so the concepts transfer even though this course demonstrates them in a different language.
The fastest way to get started, per this course, is the Project Generator: create-mcp-use-app. mcp-use includes a project generator that lets you create a new server project with a single command. Running this creates a ready-to-use server with: a TypeScript entrypoint, example tools, prompts and resources already scaffolded in, configuration files, and built-in support for the MCP Inspector (covered later in this topic). This provides a convenient starting point for building an MCP server — rather than starting from a completely blank file and wiring up the server's basic structure by hand, you get a working skeleton with example capabilities already in place to modify.
This generator-first approach mirrors a common pattern in modern developer tooling (similar in spirit to create-react-app or npm create vite): rather than documentation alone describing the pieces you need to assemble, a single scaffolding command gets you to a running, correctly-structured starting point immediately, which you then customize by editing or adding to the example tools/prompts/resources it generates.
💻 Code example
# The book's generator step (TypeScript/Node.js tooling):
# npx create-mcp-use-app my-server
# cd my-server && npm run dev
#
# Below: the same minimal-server shape using the official MCP
# Python SDK, since this book section's own examples are TypeScript.
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("my-server") # a minimal working server, the Python analog
# of what create-mcp-use-app scaffolds
@mcp.tool()
def example_tool(query: str) -> str:
"""An example tool, standing in for what the generator
pre-populates in a scaffolded TypeScript project."""
return f"Handled: {query}"
if __name__ == "__main__":
mcp.run() # starts the server, analogous to `npm run dev`
💬 Deep Dive with AI
Key points
- •A server is the source of truth for capabilities — tools, resources, prompts, and structured interactions like sampling or elicitation
- •mcp-use provides a lightweight, declarative framework for defining these capabilities
- •The book's mcp-use server examples are written in TypeScript specifically — noted here since the batch's Python code example is a translation of the same concept
- •create-mcp-use-app scaffolds a ready-to-use server: TypeScript entrypoint, example tools/prompts/resources, config files, and built-in MCP Inspector support
- •This generator-first approach gets you to a working, correctly-structured starting point immediately, rather than assembling the basic structure by hand