tiny-stdio-mcp-test-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { createEncryptServer, createWordOfTheDayServer, } from "./index.js";
4
+ const program = new Command();
5
+ program
6
+ .name("tiny-stdio-mcp-test-server")
7
+ .description("Test MCP server with example tools for integration testing")
8
+ .version("0.0.1");
9
+ program
10
+ .command("serve")
11
+ .description("Start an MCP server on stdin/stdout")
12
+ .argument("<tool>", "Tool to serve (encrypt, word-of-the-day)")
13
+ .action(async (tool) => {
14
+ const servers = {
15
+ encrypt: () => createEncryptServer().listen(),
16
+ "word-of-the-day": () => createWordOfTheDayServer().listen(),
17
+ };
18
+ const start = servers[tool];
19
+ if (!start) {
20
+ const available = Object.keys(servers).join(", ");
21
+ console.error(`Unknown tool: ${tool}. Available: ${available}`);
22
+ process.exit(1);
23
+ }
24
+ await start();
25
+ });
26
+ program.parse();
@@ -0,0 +1,4 @@
1
+ export declare function caesarEncrypt(text: string, shift: number): string;
2
+ export declare function createEncryptServer(): import("tiny-stdio-mcp-server").Server;
3
+ export declare function createWordOfTheDayServer(): import("tiny-stdio-mcp-server").Server;
4
+ export declare function createTestServer(): import("tiny-stdio-mcp-server").Server;
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import { createServer, defineSchema } from "tiny-stdio-mcp-server";
2
+ const caesarCipherSchema = defineSchema({
3
+ text: { type: "string", description: "The text to encrypt" },
4
+ shift: {
5
+ type: "number",
6
+ description: "The shift amount (default: 3)",
7
+ optional: true,
8
+ },
9
+ });
10
+ export function caesarEncrypt(text, shift) {
11
+ return text
12
+ .split("")
13
+ .map((char) => {
14
+ if (char >= "a" && char <= "z") {
15
+ return String.fromCharCode(((char.charCodeAt(0) - 97 + shift) % 26) + 97);
16
+ }
17
+ if (char >= "A" && char <= "Z") {
18
+ return String.fromCharCode(((char.charCodeAt(0) - 65 + shift) % 26) + 65);
19
+ }
20
+ return char;
21
+ })
22
+ .join("");
23
+ }
24
+ const wordOfTheDaySchema = defineSchema({});
25
+ export function createEncryptServer() {
26
+ return createServer({
27
+ name: "tiny-stdio-mcp-test-server",
28
+ version: "0.0.1",
29
+ }).tool("caesar_cipher_encrypt", "Encrypts text using the Caesar cipher", caesarCipherSchema, ({ text, shift }) => {
30
+ const actualShift = shift ?? 3;
31
+ return caesarEncrypt(text, actualShift);
32
+ });
33
+ }
34
+ export function createWordOfTheDayServer() {
35
+ return createServer({
36
+ name: "tiny-stdio-mcp-test-server",
37
+ version: "0.0.1",
38
+ }).tool("word_of_the_day", "Returns the word of the day", wordOfTheDaySchema, () => {
39
+ return "Bumfuzzle - to confuse or fluster someone";
40
+ });
41
+ }
42
+ export function createTestServer() {
43
+ const server = createServer({
44
+ name: "tiny-stdio-mcp-test-server",
45
+ version: "0.0.1",
46
+ });
47
+ server.tool("caesar_cipher_encrypt", "Encrypts text using the Caesar cipher", caesarCipherSchema, ({ text, shift }) => {
48
+ const actualShift = shift ?? 3;
49
+ return caesarEncrypt(text, actualShift);
50
+ });
51
+ server.tool("word_of_the_day", "Returns the word of the day", wordOfTheDaySchema, () => {
52
+ return "Bumfuzzle - to confuse or fluster someone";
53
+ });
54
+ return server;
55
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "tiny-stdio-mcp-test-server",
3
+ "version": "0.1.0",
4
+ "description": "Test MCP server with example tools for integration testing",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "tiny-stdio-mcp-test-server": "dist/cli.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "prepublishOnly": "tsc"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "engines": {
25
+ "node": ">=18"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/poe-platform/poe-code.git",
30
+ "directory": "packages/tiny-stdio-mcp-test-server"
31
+ },
32
+ "license": "MIT",
33
+ "keywords": [
34
+ "mcp",
35
+ "model-context-protocol",
36
+ "test",
37
+ "server"
38
+ ],
39
+ "dependencies": {
40
+ "tiny-stdio-mcp-server": "*",
41
+ "commander": "^14.0.3"
42
+ },
43
+ "devDependencies": {
44
+ "@modelcontextprotocol/sdk": "^1.25.3"
45
+ }
46
+ }