Skip to content

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.

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.

Terminal window
pnpm dlx @dynemcp/create-dynemcp
  • Follow the interactive prompts to choose your project name and template (default-stdio or default-http).
  • The CLI will scaffold your project in a new directory.
Terminal window
cd your-project-name
pnpm install
Terminal window
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.


If you want full control or need to integrate DyneMCP into an existing monorepo, you can set up a project manually.

Terminal window
mkdir my-dynemcp-project
cd my-dynemcp-project
Terminal window
pnpm init
Terminal window
pnpm add dynemcp
  • 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).
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',
},
},
}
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)

In your package.json:

{
"scripts": {
"dev": "dynemcp dev"
}
}
Terminal window
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.