If a tool requires a constant that is not configured, the tool will not be available to the LLM.
- In the dashboard: In the “Constants” tabs, this will set some sort of default values for the plug.
- In the client: When initializing the mcplug client, provide constants as part of the configuration. Provided constants will override the ones in the dashboard.
Passing Constants to the Client
When initializing the mcplug client, provide constants as part of the configuration:How Constants Work
On the server side, constants are identified by an underscore prefix (_
) in the tool’s input schema. When you provide these constants during client initialization, they’re automatically passed to the corresponding tools when called.
This approach keeps sensitive information secure, as the LLM has no access to these constants.
Weather API Example
Consider a weather MCP server requiring a paid API key to fetch weather data for specific cities:- The MCP server developer creates a
getWeather
tool that requires a city name and theWEATHER_API_KEY
constant - You provide the API key during client initialization
Gmail Integration Example
For Gmail tool integration:- You must provide all necessary authentication credentials
- Mcplug doesn’t generate these credentials
- You’ll need to create your own OAuth2.0 client ID and client secret and store them securely
- Store the refresh token in your database as well