Skip to main content

Project Configuration Overview

This guide explains how to set up your project for MCP server deployment. Configuration files should be stored in the root directory of your repository (or in a subdirectory, for monorepos) and define how to build and run your server.

Key Concepts

Required Configuration Files

  1. Dockerfile: Defines the process for building your server’s container image.
  2. Configuration YAML (e.g., cogni.yaml): Specifies how to start and run your server, including the startup command and exposed port.

Automatic Setup

Deployment systems may attempt to auto-generate these files, but manual setup could be necessary if automation fails.

File Details

Dockerfile Example Basic Python server container setup:
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ["python", "server.py"]
YAML Configuration Example Specifies how the server should be started:
version: 1
start:
  command: ["python", "server.py"]
  port: 8000

Project Structure Considerations

If using a monorepo or a nested project structure, place the configuration files within the subdirectory containing your server. Be sure to indicate this subdirectory in your server settings during deployment configuration.

Best Practices

  • Local Testing: Verify the server builds and runs locally before deployment. Tools like MCP Inspector can assist.
  • Validation: Use a schema to define and validate server configuration options.
  • Efficiency: Optimize Docker images by using minimal base images and multi-stage builds.

Deployment

After setting up the configuration files, you can proceed to deploy your server using your chosen deployment method.