MCP Server Config Guideline
Installation and operation
Installation dependencies
Please ensure that Python version 3.7 or above is installed in the system. You need to install the following dependencies:
Configuration File
The tool manages server and client settings through a configuration file. Below is an example structure of the config.json
file:
Configuration Items Explanation
Server Configuration (object)
command
(string): The command to execute the script (typically the Python interpreter)args
(array): Arguments passed to the script, including:Path to the Python script (replace
{replace-with-your-path}
with your actual path)
Input Parameter Explanation
The get_response
function has two input parameters:
query
: This is the user input query that the tool will use to request the model. For example, the user might ask questions like "How is the weather?" or "What can you do for me?"
instance_id
: This is a string used to identify a specific model instance. Typically, instance_id
might be the model's URL path or a unique identifier used to specify an instance on the model platform.
Response
Server-Sent Events (SSE) stream in OpenAI-compatible format
Each event contains a fragment of the generated response
The last event is marked as
[DONE]
Response Format Example
Note
Currently, MCP services automatically process streaming data to generate coherent paragraphs. If you need RAW results, you can directly return a 'response' in the code. You can change it yourself according to the following code.
Last updated