Constants
Using constants or secrets in your MCP server
When deploying your MCP server, you may need the developer who is using your MCP server to provide constants or secrets. These can be API keys for your service or authentication tokens.
These constants are not something the LLM will be able to access or use in the prompt. It is the responsibility of the developer to provide the constants.
For example, if I develop an MCP server that is a weather service, the developer will need to give me the API key for the weather service, and the LLM will need to provide the city name.
Define a constant
To define a constant that your tool will access, you have to prefix a property with an underscore _
in your input schema.
In this example, the _WEATHER_API_KEY
is a constant that will be provided by the developer and the city
is the city name that the LLM will provide.
How constants are passed to the tool
Constants are passed to the tool when the developer initializes the mcplug
client or by setting them in the plug dashboard.