Move whole rmcp crate to offcial rust sdk (#44)
* get rid of async-trait * move rmcp to official-rust-sdk * replace master with main * update readme, change license * fix typo * Update README.md Co-authored-by: Jefry Dewangga <jefrydco@gmail.com> * fix typos --------- Co-authored-by: = <=> Co-authored-by: Jefry Dewangga <jefrydco@gmail.com>
This commit is contained in:
parent
31493cfbcc
commit
0be6067326
1 changed files with 8676 additions and 4466 deletions
28
crates/rmcp/tests/test_with_js/client.js
Normal file
28
crates/rmcp/tests/test_with_js/client.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
||||
|
||||
const transport = new SSEClientTransport( new URL(`http://127.0.0.1:8000/sse`));
|
||||
|
||||
const client = new Client(
|
||||
{
|
||||
name: "example-client",
|
||||
version: "1.0.0"
|
||||
},
|
||||
{
|
||||
capabilities: {
|
||||
prompts: {},
|
||||
resources: {},
|
||||
tools: {}
|
||||
}
|
||||
}
|
||||
);
|
||||
await client.connect(transport);
|
||||
const tools = await client.listTools();
|
||||
console.log(tools);
|
||||
const resources = await client.listResources();
|
||||
console.log(resources);
|
||||
const templates = await client.listResourceTemplates();
|
||||
console.log(templates);
|
||||
const prompts = await client.listPrompts();
|
||||
console.log(prompts);
|
||||
await client.close();
|
||||
Loading…
Reference in a new issue