Skip to content

Commit 9a74237

Browse files
committed
http example
1 parent 64fc075 commit 9a74237

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/http_example.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { MCPAgent, MCPClient } from '../index.js'
2323
config()
2424

2525
async function main() {
26-
const config = { mcpServers: { http: { url: 'https://hf.com/mcp' } } }
26+
const config = { mcpServers: { http: { url: 'https://gitmcp.io/docs' } } }
2727

2828
// Create MCPClient from config
2929
const client = MCPClient.fromDict(config)
@@ -36,10 +36,12 @@ async function main() {
3636

3737
// Run the query
3838
const result = await agent.run(
39-
'Find the best restaurant in San Francisco USING GOOGLE SEARCH',
39+
'Which tools are available and what can they do?',
4040
30,
4141
)
4242
console.log(`\nResult: ${result}`)
43+
44+
await agent.close()
4345
}
4446

4547
if (import.meta.url === `file://${process.argv[1]}`) {

0 commit comments

Comments
 (0)