Skip to content

Commit f16ea0c

Browse files
committed
great progress
1 parent 98b9851 commit f16ea0c

File tree

126 files changed

+55003
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+55003
-108
lines changed
Lines changed: 1 addition & 0 deletions

β€Žexercises/01.start/01.problem/package.jsonβ€Ž renamed to β€Žexercises/01.ping/01.problem/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "exercises_01.start_01.problem",
2+
"name": "exercises_01.ping_01.problem",
33
"private": true,
44
"type": "module",
55
"scripts": {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
2+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
3+
import { test, beforeAll, afterAll, expect } from 'vitest'
4+
5+
let client: Client
6+
7+
beforeAll(async () => {
8+
client = new Client({
9+
name: 'EpicMeTester',
10+
version: '1.0.0',
11+
})
12+
const transport = new StdioClientTransport({
13+
command: 'tsx',
14+
args: ['src/index.ts'],
15+
})
16+
await client.connect(transport)
17+
})
18+
19+
afterAll(async () => {
20+
await client.transport?.close()
21+
})
22+
23+
test('Ping', async () => {
24+
const result = await client.ping()
25+
26+
expect(result).toEqual({})
27+
})

β€Žexercises/01.start/01.problem/src/index.tsβ€Ž renamed to β€Žexercises/01.ping/01.problem/src/index.tsβ€Ž

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
// πŸ’° you're gonna want these imports
22
// import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
33
// import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
4-
// import { z } from 'zod'
54

65
// 🐨 create a new McpServer
7-
// - it should have a name of 'EpicMath' and a version of '1.0.0'
8-
// - it should have a capabilities object with a tools property that is an empty object
6+
// - it should have a name of 'EpicMe' and a version of '1.0.0'
97
// - it should have instructions for the LLM to know what this server can be used to do
108

11-
// 🐨 add a tool to the server with the server.tool API
12-
// - it should be named 'add'
13-
// - it should have a description explaining what it can be used to do
14-
// - provide an input schema object with two properties which are validated with zod (give them descriptions as well):
15-
// - firstNumber: a number
16-
// - secondNumber: a number
17-
// - it should return a standard text response with the sum of the two numbers
18-
199
async function main() {
2010
// 🐨 create a new StdioServerTransport
2111
// 🐨 connect the server to the transport
Lines changed: 1 addition & 0 deletions

β€Žexercises/02.next/01.solution/package.jsonβ€Ž renamed to β€Žexercises/01.ping/01.solution/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "exercises_02.next_01.solution",
2+
"name": "exercises_01.ping_01.solution",
33
"private": true,
44
"type": "module",
55
"scripts": {

0 commit comments

Comments
Β (0)