1. Conduid
  2. Browser
  3. Mcpx4j
MCP server · Browser

Mcpx4j

Java client library for https://mcp.run - call portable and secure tools for your AI Agents and Apps

Unclaimed BSD-3-Clause last commit 11 months ago browser
59Fair

Scored yesterday · breakdown

About Mcpx4j

Mcpx4j is an MCP server published by dylibso in the Browser category: java client library for https://mcp.run - call portable and secure tools for your AI Agents and Apps.

The repository has 29 stars and 3 forks, with the last commit 11 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/dylibso/mcpx4j

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Mcpx4j

Powered by Claude · Grounded in docs

I know everything about Mcpx4j. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository yesterday. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

1 check has not been run yet.

Releases

0.2.00.2.0
0.1.20.1.2
0.1.10.1.1

README

MCPX4J

The MCP.RUN client library for Java!

Installation

<dependencies>
    <dependency>
       <groupId>com.dylibso.mcpx4j</groupId>
        <artifactId>mcpx4j</artifactId>
        <version>${mcpx4j.version}</version>
    </dependency>
</dependencies>

Quick Start

Create a new Mcpx instance with your API key and start invoking your installed tools.

import com.github.dylibso.mcpx4j.Mcpx;

Mcpx mcpx = Mcpx.forApiKey(apiKey).build();
mcpx.refreshInstallations();
var servlet = mcpx.get("my-servlet-id");
var tool = servlet.get("my-tool-id");
var bytes = servlet.call("""
{
    "method": "tools/call",
    "params": {
        "name": "my-tool-id",
        "arguments": {
            ...
        }  
    }
}
""");

Detailed examples are available in the examples directory.

Plugin Updates

Mcpx keeps a cache of installations. You can refresh the cache by calling refreshInstallations(). The internal store is thread-safe, so you can schedule a refresh in a separate thread.

var scheduler = Executors.newSingleThreadScheduledExecutor();
scheduler.scheduleAtFixedRate(mcpx::refreshInstallations, 0, 5, TimeUnit.MINUTES);

Configuration

It is possible to provide an alternative base URL for the mcp.run service (defaults to https://www.mcp.run).

var mcpx = Mcpx.forApiKey(apiKey)
    .withBaseUrl(jsonDecoder)
    ...
    .build();

The Mcpx builder allows to customize the JSON decoder and the HTTP client.

JSON Decoder

var mcpx = Mcpx.forApiKey(apiKey)
    .withBaseUrl("https://localhost:8080")
    ...
    .build();

The default JSON decoder is JacksonDecoder, using Jackson Databind. We also provide an alternative implementation based on Jakarta JSON-P.

Both dependencies are optional, so you should make sure to include them in your project if you want to use them.

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson-databind.version}</version>
    </dependency>

    <!-- Eclipse Parsson is an implementation of the Jakarta JSON-P API  -->
    <dependency>
        <groupId>org.eclipse.parsson</groupId>
        <artifactId>parsson</artifactId>
        <version>${parsson.version}</version>
    </dependency>

HTTP Client

var mcpx = Mcpx.forApiKey(apiKey)
    .withHttpClientAdapter(httpClientAdapter)
    ...
    .build();

The default HTTP client is JdkHttpClientAdapter, using the JDK HTTP client, there is also a lighter-weight implementation using an HttpURLConnection, called HttpUrlConnectionClientAdapter.

var mcpx = Mcpx.forApiKey(apiKey)
    .withHttpClientAdapter(new JdkHttpClientAdapter())
    .withHttpClientAdapter(new HttpUrlConnectionClientAdapter()) // alternatively
    ...
    .build();

The HttpClientAdapter interface is currently borrowed from the Chicory Extism SDK. This might change in the future.

Servlet Options

It is also possible to provide predefined options for the Servlet implementation: these config options are propagated to the Chicory Extism SDK upon creation of each Servlet.

var mcpx = Mcpx.forApiKey(apiKey)
    .withServletOptions(McpxServletOptions.builder()
        .withChicoryHttpConfig(...)
        .withChicoryLogger(...)
        .withAoT() 
        .build())
    .build();
  • ChicoryHttpConfig controls the HTTP client and Json decoder used by the Chicory SDK: usually these should match the ones used by the MCPX4J client.
  • ChicoryLogger is a logger implementation for the Chicory SDK.
  • AoT enables the Ahead-of-Time compilation for the Chicory SDK.

README fetched from the repository yesterday. The original is authoritative.

Questions

About Mcpx4j

How do I install Mcpx4j?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Mcpx4j safe to use with an AI agent?

Its trust score is 59 out of 100 (fair). It passes 3 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Mcpx4j still maintained?

The last commit was 11 months ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.