This topic lists common problems and provides solutions for deploying and using an MCP Server with Function AI.
How to get the endpoint of an MCP Server
In the Function AI console, go to the project page and click the name of the project that contains your MCP Server. On the product page for the service, click the Service Test tab to view the service endpoint.
What to do if an MCP Server is deployed but cannot be accessed
Check the MCP Server logs to identify the cause of the startup failure.
An MCP Server is usually inaccessible because the function fails to start due to issues with the MCP code or configuration. The following are common causes:
Incorrect start command configuration
For example, you select the Java runtime and configure the start command as
java -jar ./target/mcp-server-1.0-SNAPSHOT.jar. However, the directory structure of your code package does not contain a `target` directory. You must adjust the directory path in the start command to match the actual structure.Dependency files not included in the package
For example, if you select the Python runtime and set the build command to
pip install -r requirements.txt, the dependencies are not downloaded into the build directory. To fix this, change the build command topip install -r requirements.txt -t ..Incorrect listening port configuration for a Server-Sent Events (SSE) MCP Server
For example, the listening port is set to 8080 in the MCP code, but the port for the MCP Server is configured as 9000.
Incorrect Protocol Type configuration
For example, your code is for a standard input/output (STDIO)-based MCP, but the Protocol Type for the MCP Server is set to SSE.
Incorrect authentication configuration
If authentication is enabled for the MCP Server, the MCP Client must include the authentication header. The JSON configuration is as follows:
{ "headers": { "Authorization": "Bearer $TOKEN" } }The Bearer Token value is available on the Service Test page.