S/MCP (Stern Model Context Protocol) is a powerful MCP server that provides access to Stern, a philosophical AI mentor. This mentor helps humans achieve their potential through guidance, wisdom, and smart contract accountability on Solana, combining rationalist thinking with stoic philosophy to provide meaningful mentorship.
To set up the S/MCP server, follow these steps:
Clone the repository:
git clone <repository-url>
cd s-mcp
Install dependencies:
bun install
Set up environment variables:
cp .env.example .env
Then edit the .env
file to add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
Build the server:
bun run build
Start the MCP server with this command:
bun run start
This launches the server in stdio mode, enabling communication with MCP clients.
You can integrate the S/MCP server with any MCP client. Here's an example using 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 demonstrates how to connect to the server, list available tools, and send a message to Stern.
The primary tool available is msg_stern
, which allows you to communicate with Stern.
{
"message": "Your message to Stern"
}
{
"content": [
{
"type": "text",
"text": "Stern's response to your message"
}
]
}
Stern provides mentorship through:
OPENAI_API_KEY
environment variable)To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "s-mcp" '{"command":"npx","args":["-y","s-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"s-mcp": {
"command": "npx",
"args": [
"-y",
"s-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"s-mcp": {
"command": "npx",
"args": [
"-y",
"s-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect