Installation Guide
Installation Guide
Section titled “Installation Guide”This guide explains how to create a new DyneMCP project using the recommended CLI tool, as well as how to set up a project manually for advanced users.
Recommended: Using create-dynemcp
Section titled “Recommended: Using create-dynemcp”The fastest way to start a new DyneMCP project is with the official project generator. This sets up everything for you, including the correct structure, dependencies, and a working template.
1. Create a New Project
Section titled “1. Create a New Project”pnpm dlx @dynemcp/create-dynemcp
- Follow the interactive prompts to choose your project name and template (
default-stdio
ordefault-http
). - The CLI will scaffold your project in a new directory.
2. Install Dependencies
Section titled “2. Install Dependencies”cd your-project-namepnpm install
3. Start the Development Server
Section titled “3. Start the Development Server”pnpm run dev
Your DyneMCP server will start, and you can begin developing your tools, resources, and prompts.
See the Getting Started and Templates Guide for next steps and customization.
Manual Installation (Advanced)
Section titled “Manual Installation (Advanced)”If you want full control or need to integrate DyneMCP into an existing monorepo, you can set up a project manually.
1. Create a New Directory
Section titled “1. Create a New Directory”mkdir my-dynemcp-projectcd my-dynemcp-project
2. Initialize a package.json
Section titled “2. Initialize a package.json”pnpm init
3. Install DyneMCP
Section titled “3. Install DyneMCP”pnpm add dynemcp
4. Create the Required Structure
Section titled “4. Create the Required Structure”- Create the following folders:
src/tools
src/resources
src/prompts
- Create a
dynemcp.config.ts
file in the project root. See the Configuration API for details. - Create a
src/index.ts
file as your server entry point (see example below).
Example: Minimal dynemcp.config.ts
Section titled “Example: Minimal dynemcp.config.ts”export default { server: { name: 'my-dynemcp-project', version: '1.0.0', }, tools: { enabled: true, directory: './src/tools', pattern: '**/*.{ts,js}', }, resources: { enabled: true, directory: './src/resources', pattern: '**/*.{ts,js}', }, prompts: { enabled: true, directory: './src/prompts', pattern: '**/*.{ts,js}', }, transport: { type: 'http', options: { mode: 'streamable-http', port: 3001, endpoint: '/mcp', }, },}
Example: Minimal src/index.ts
Section titled “Example: Minimal src/index.ts”import { createMCPServer } from 'dynemcp'
const serverPromise = createMCPServer()
async function main() { const server = await serverPromise await server.init() await server.start()}
process.on('SIGINT', async () => { console.log('\n🛑 Shutting down server...') const server = await serverPromise await server.stop() process.exit(0)})
process.on('SIGTERM', async () => { console.log('\n🛑 Shutting down server...') const server = await serverPromise await server.stop() process.exit(0)})
main().catch(console.error)
5. Add a Start Script
Section titled “5. Add a Start Script”In your package.json
:
{ "scripts": { "dev": "dynemcp dev" }}
6. Start the Server
Section titled “6. Start the Server”pnpm run dev
- For most users, the CLI generator is recommended.
- For custom setups, follow the manual steps and refer to the API docs for configuration options.
- See Getting Started for a walkthrough of your first project.
- See Templates Guide for details on project structure and customization.