Bitcoin MCP Server

by kappaj2

250 downloads
Not rated
GitHub

Description

# Bitcoin MCP Server This project provides a Model Context Protocol (MCP) server for Bitcoin price information. ## Building the Project To build the project, run: ```bash mvn clean package ``` This will create a JAR file at `target/bitcoinmcp-0.0.1-SNAPSHOT.jar`. ## Running the…

About

# Bitcoin MCP Server This project provides a Model Context Protocol (MCP) server for Bitcoin price information. ## Building the Project To build the project, run: ```bash mvn clean package ``` This will create a JAR file at `target/bitcoinmcp-0.0.1-SNAPSHOT.jar`. ## Running the MCP Server The server is configured to…

Details

Author
kappaj2
Downloads
250
Categories
Finance

- Single tool: getBitcoinProceByCurrency (accepts currency code)
- STDIO-based transport (no network ports required)
- Java / Maven project (portable JAR)
- Test client demonstrates connection, tool listing, and invocation
- Built for integration with MCP-aware AI agents

Build the server with mvn clean package to produce a JAR file. The server uses STDIO transport and is launched automatically by an MCP client. A test client (ClientSTDIO) is included; run it with mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass="za.sk.bitconmcp.ClientSTDIO". The server JAR path can be set via the system property mcp.server.jar.path or the environment variable MCP_SERVER_JAR_PATH.

Bitcoin MCP Server

This project provides a Model Context Protocol (MCP) server for Bitcoin price information.

Building the Project

To build the project, run:

mvn clean package

This will create a JAR file at target/bitcoinmcp-0.0.1-SNAPSHOT.jar.

Running the MCP Server

The server is configured to use standard input/output (STDIO) for communication, as specified in the application.yaml file.

Using the ClientSTDIO Test Client

The project includes a test client (ClientSTDIO) that demonstrates how to connect to the MCP server.

Why ClientSTDIO Needs to See the Server JAR

The ClientSTDIO class uses the Model Context Protocol (MCP) client library to communicate with the MCP server. It needs to reference the server JAR file because:

1. The MCP client uses a subprocess mechanism to start the server
2. It launches the server by executing the JAR file as a separate Java process
3. The client and server communicate via standard input/output (STDIO)

This architecture allows the client to interact with the server without requiring the server to be started separately or to expose network ports. However, it means the client needs to know the location of the server JAR file to start it.

Configuring the JAR File Path

The client needs to know the location of the server JAR file. There are three ways to specify this:

1. System Property:

   java -Dmcp.server.jar.path=/path/to/bitcoinmcp-0.0.1-SNAPSHOT.jar -cp target/test-classes za.sk.bitconmcp.ClientSTDIO

2. Environment Variable:

   export MCP_SERVER_JAR_PATH=/path/to/bitcoinmcp-0.0.1-SNAPSHOT.jar
java -cp target/test-classes za.sk.bitconmcp.ClientSTDIO

3. Default Path:
If neither the system property nor the environment variable is set, the client will look for the JAR file at target/bitcoinmcp-0.0.1-SNAPSHOT.jar relative to the current working directory.

Running the Client

To run the client, use Maven's exec plugin to ensure all dependencies are included in the classpath:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.