lnfi-mcp-node-service-test
v1.0.0-beta.60
Published
This is a Model Context Protocol (MCP) server built with Node.js that provides AI assistants with secure access to LnFi trading and token management APIs.
Readme
LnFi MCP Server
This is a Model Context Protocol (MCP) server built with Node.js that provides AI assistants with secure access to LnFi trading and token management APIs.
Quick Start
npx
Please replace with your Nostr private key: xxxxxxxxxxxxxxxxxxxx Or /path/private.key
Option 1: Using command line arguments
{
"mcpServers": {
"lnfi-mcp-server": {
"command": "npx",
"args": [
"-y",
"@lnfi-network/lnfi-mcp-server",
"--privateKey=xxxxxxxxxxxxxxxxxxxx" // Required: Nostr private key Or /path/private.key
]
}
}
}Option 2: Using environment variables
{
"mcpServers": {
"lnfi-mcp-server": {
"command": "npx",
"args": [
"-y",
"@lnfi-network/lnfi-mcp-server"
],
"env": {
"LNFI_PRIVATE_KEY": "xxxxxxxxxxxxxxxxxxxx" // Required: Nostr private key Or /path/private.key
}
}
}
}Development
Installation
- Make sure you have Node.js installed (version 16 or higher recommended)
- Clone this repository
- Install dependencies:
npm install @lnfi-network/lnfi-mcp-serverBuilding the Project
To compile TypeScript files to JavaScript:
npm run buildThis will:
- Compile TypeScript files using
tsc - Make the built files executable
Usage
After building, you can start the server with:
npm startProgrammatic Usage
After installing the package, you can use it programmatically in your Node.js application:
import { getLnfiMcpServer } from "@lnfi-network/lnfi-mcp-server";
// Initialize the MCP server
const lnfiMcpServer = await getLnfiMcpServer({
privateKey: process.env.LNFI_PRIVATE_KEY, // Required: Nostr private key Or /path/private.key
signer // Optional: custom signer instance | window?.okxwallet?.nostr
});
// Access available tools
const lnfiTools = lnfiMcpServer._registeredTools;
console.log('Available LnFi tools:', Object.keys(lnfiTools));Dependencies
- @lnfi-network/lnfi-sdk - LnFi API client
- zod - TypeScript-first schema validation
- @modelcontextprotocol/sdk - Model Context Protocol SDK
