Skip to content

Unable to connect to mcpServer of modelscope.com/baidu.com #736

@zxbjushuai

Description

@zxbjushuai

First, I will provide the code I used for testing.

package io.modelcontextprotocol.client;

import io.modelcontextprotocol.client.transport.HttpClientSseClientTransport;
import io.modelcontextprotocol.spec.McpClientTransport;

import java.time.Duration;

public class ModelScopeMcpTest extends AbstractMcpSyncClientTests {

    private static final String MODELSCOPE_MCP_URL = "https://mcp.api-inference.modelscope.net/111111/sse";
    // Here is an example URL. To test, you should deploy your own model/service on ModelScope to get a personal endpoint.

    @Override
    protected McpClientTransport createMcpTransport() {
        return HttpClientSseClientTransport.builder(MODELSCOPE_MCP_URL)
                .build();
    }
    @Override
    protected Duration getRequestTimeout() {
        return Duration.ofSeconds(30);
    }

    @Override
    protected Duration getInitializationTimeout() {
        return Duration.ofSeconds(10);
    }
}

created this file in the directory
java-sdk\mcp-test\src\main\java\io\modelcontextprotocol\client\ModelScopeMcpTest.java.

I will provide the test results in the attachment.
testResult-ModelScopeMcpTest.html

I am quite certain that this MCP server is functional, as I was able to successfully connect to it using Cherry Studio.

Image

Regarding the Baidu API:
https://mcp.map.baidu.com/sse?ak=123456
, the main error is that the ak parameter in the API was not included in the request query, resulting in authentication failure. However, when I tested using the MCP Python SDK, I was easily able to connect to these vendor services (I can provide the Python test code if necessary). My question is: Is there an issue with my testing method, or does the current version not support connecting to these vendors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions