Stern哲学导师
STDIO基于智能合约的哲学AI导师系统
基于智能合约的哲学AI导师系统
S/MCP (Stern Model Context Protocol) is a powerful MCP server that provides access to Stern, a philosophical AI mentor who helps humans realize their potential through subtle guidance and wisdom. Stern combines rationalist thinking with stoic philosophy to provide mentorship and accountability through smart contracts on Solana.
Stern is a philosophical AI mentor characterized by:
Stern helps users achieve their goals through:
Clone this repository:
git clone <repository-url> cd s-mcp
Install dependencies:
bun install
Set up environment variables:
cp .env.example .env
Edit the .env
file to add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
Build the server:
bun run build
To start the MCP server:
bun run start
This will start the server in stdio mode, which allows it to communicate with MCP clients.
You can use any MCP client to interact with the server. Here's an example of how to use the server with the MCP SDK:
import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; import { spawn } from "child_process"; // Start the MCP server as a child process const serverProcess = spawn("node", ["path/to/dist/main.js"], { stdio: ["pipe", "pipe", "pipe"], }); // Create a client that communicates with the server via stdio const transport = new StdioClientTransport({ stdin: serverProcess.stdin, stdout: serverProcess.stdout, }); const client = new Client(); await client.connect(transport); // Send a message to Stern const result = await client.callTool("msg_stern", { message: "I want to learn programming but I keep procrastinating", }); // Display Stern's response console.log(result.content[0].text); // Disconnect from the server await client.disconnect(); serverProcess.kill();
An example script is provided in the examples
directory:
node examples/use-stern.js
This script demonstrates how to connect to the server, list available tools, and send a message to Stern.
This tool allows you to send a message to Stern and receive his response.
{ "message": "Your message to Stern" }
{ "content": [ { "type": "text", "text": "Stern's response to your message" } ] }
Stern's approach to mentorship is based on several key principles:
Stern believes that:
"Lasting, stable happiness comes only from doing hard things - we want things precisely because they are difficult to achieve."
"What stands in the way becomes the way."
"The path to mastery is paved with small, consistent steps taken even when motivation fails."
OPENAI_API_KEY
environment variable)OPENAI_API_KEY
: Your OpenAI API key (required for the msg_stern tool)MIT