Skip to content

Instantly share code, notes, and snippets.

@rido-min
Last active September 20, 2025 04:42
Show Gist options
  • Select an option

  • Save rido-min/b81d72ebced24a79165997224b0c1794 to your computer and use it in GitHub Desktop.

Select an option

Save rido-min/b81d72ebced24a79165997224b0c1794 to your computer and use it in GitHub Desktop.
quote-agent
import { App } from '@microsoft/teams.apps'
const app = new App()
app.on('message', async ({ send, activity }) => {
await send(`you said "${activity.text}"`)
})
await app.start()
{
"type": "module",
"scripts": {
"build": "tsc --build",
"prestart": "npm run build",
"start": "node ./dist/app.js"
},
"dependencies": {
"@microsoft/teams.apps": "^2.0.0",
"@openai/agents": "^0.1.3"
},
"devDependencies": {
"typescript": "^5.9.2"
}
}
import { Agent, hostedMcpTool, run } from '@openai/agents'
import { App } from '@microsoft/teams.apps'
const agent = new Agent({
name: 'MCP Assistant',
instructions: 'You must always use the MCP tools to answer questions.',
tools: [
hostedMcpTool({
serverLabel: 'msdocs',
serverUrl: 'https://learn.microsoft.com/api/mcp',
}),
],
})
const app = new App()
app.on('message', async ({ send, activity }) => {
send(`You said "${activity.text}", let me think...`)
const result = await run(agent, activity.text);
send(result.finalOutput!)
})
app.start()
{
"compilerOptions": {
"target": "ES2022",
"moduleResolution": "nodenext",
"module": "nodenext",
"outDir": "./dist",
"rootDir": "./src",
"tsBuildInfoFile": "./dist/.tsbuildinfo"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment