This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Server } from "@modelcontextprotocol/sdk/server/index.js"; | |
| import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; | |
| const server = new Server({ | |
| name: "my-mcp-server", | |
| version: "1.0.0", | |
| }); | |
| const transport = new StdioServerTransport(); | |
| await server.connect(transport); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Client } from "@modelcontextprotocol/sdk/client/index.js"; | |
| const client = new Client({ | |
| name: "my-app", | |
| version: "1.0.0" | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Server } from "@modelcontextprotocol/sdk/server/index.js"; | |
| import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; | |
| const server = new Server({ | |
| name: "my-mcp-server", | |
| version: "1.0.0" | |
| }); | |
| const transport = new StdioServerTransport(); | |
| await server.connect(transport); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Server } from "@modelcontextprotocol/sdk/server/index.js"; | |
| import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; | |
| const server = new Server({ | |
| name: "my-mcp-server", | |
| version: "1.0.0" | |
| }); | |
| const transport = new StdioServerTransport(); | |
| await server.connect(transport); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Client } from "@modelcontextprotocol/sdk/client/index.js"; | |
| const client = new Client({ | |
| name: "my-app", | |
| version: "1.0.0" | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // translation-agent.js | |
| import express from "express"; | |
| const app = express(); | |
| app.use(express.json()); | |
| // IMPLICIT CONTRACT: expects req.body.text | |
| app.post("/translate", async (req, res) => { | |
| const text = req.body?.text; | |
| const supportedLanguages = ["es", "fr", "de"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // summary-agent.js | |
| import fetch from "node-fetch"; | |
| async function generateReviewSummary(reviewText: string[]) { | |
| // Step 1: Generate summary using LLM | |
| // (This is a placeholder for actual LLM integration) | |
| const summary = `Summary: ${reviewText.join(", ")}`; | |
| // Step 2: Invoke translation agent | |
| const payload = { text: summary }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Server } from "@modelcontextprotocol/server"; | |
| import { stdioServer } from "@modelcontextprotocol/server/stdio"; | |
| import { TextContent } from "@modelcontextprotocol/types"; | |
| async function serve() { | |
| const server = new Server("refund-agent"); | |
| // Advertise available tools | |
| server.listTools(async () => [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // translation-agent.js | |
| import express from "express"; | |
| const app = express(); | |
| app.use(express.json()); | |
| // IMPLICIT CONTRACT: expects req.body.text | |
| app.post("/translate", async (req, res) => { | |
| const text = req.body?.text; | |
| const supportedLanguages = ["es", "fr", "de"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Server } from "@modelcontextprotocol/server"; | |
| import { stdioServer } from "@modelcontextprotocol/server/stdio"; | |
| import { TextContent } from "@modelcontextprotocol/types"; | |
| async function serve() { | |
| const server = new Server("refund-agent"); | |
| // Advertise available tools | |
| server.listTools(async () => [ | |
| { |
NewerOlder