This guide provides detailed instructions on how to build, configure, and run the Multi-Source Media MCP Server (M3S).
- Go: Version 1.25.1 or higher.
To build the server, navigate to the project's root directory and run the following command:
m3s-serverThis will create an executable file named mmts-server in the project root.
The server is configured using a YAML file (configs/config.yaml by default) that supports environment variable substitution.
The config.yaml file defines the server's configuration. You can use the ${VAR:default} syntax to substitute values from environment variables at runtime.
Example config.yaml:
mode: ${MODE:streamhttp}
addr: ${LISTEN_ADDR:0.0.0.0:18061}
# API Keys & Endpoints
pexelsAPIKey: ${PEXELS_API_KEY}
unsplashAPIKey: ${UNSPLASH_API_KEY}
siliconAPIKey: ${SILICON_API_KEY}
siliconBaseURL: ${SILICON_BASE_URL}
siliconModel: ${SILICON_MODEL}To provide values for the placeholders in config.yaml, you can either set environment variables directly or create a .env file in the project root.
Example .env file:
# .env
# Server Configuration
MODE=streamhttp
LISTEN_ADDR=127.0.0.1:9000
# API Keys & Endpoints
PEXELS_API_KEY=your-pexels-api-key
UNSPLASH_API_KEY=your-unsplash-api-key
SILICON_API_KEY=your-silicon-api-key
SILICON_BASE_URL=https://api.siliconflow.cn/v1
SILICON_MODEL=your-model-name
OPENAI_API_KEY=your-openai-api-key
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=dall-e-3
The server will automatically load the .env file and substitute the variables into the configuration when it starts.
To run the server with the default configuration (configs/config.yaml):
./mmts-serverTo use a different configuration file, use the --config command-line flag:
./mmts-server --config=path/to/your/config.yaml