Teams Chat MCP Collaboration
Read and send Microsoft Teams messages: chats, team channels and threads, as a Microsoft 365 account you sign in with. Sending is off until you allow it.
Quick start
- Add a Teams Chat connection with the settings below, then click Test configuration.
- Create an API key for your agent.
- Paste the key below, click Test endpoint, and copy the configuration for your platform.
| Endpoint | https://market.oshaani.com/teams-chat (your default connection) or https://market.oshaani.com/teams-chat/<connection-id> |
|---|---|
| Transport | Streamable HTTP (stateless, JSON responses). MCP protocol versions 2024-11-05 to 2025-11-25 and 2026-07-28. |
| Authentication | Authorization: Bearer <API key>, using a key from the API keys page. |
Agent configuration
initialize and tools/list against the endpoint, exactly like an agent. No credits are charged.
Any MCP client that supports remote (Streamable HTTP) servers with custom headers.
{
"name": "teams-chat",
"transport": "streamable-http",
"url": "https://market.oshaani.com/teams-chat",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
~/.cursor/mcp.json (all projects) or .cursor/mcp.json in a project.
{
"mcpServers": {
"teams-chat": {
"url": "https://market.oshaani.com/teams-chat",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Settings > Developer > Edit Config (claude_desktop_config.json). Uses the mcp-remote bridge; needs Node.js.
{
"mcpServers": {
"teams-chat": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://market.oshaani.com/teams-chat",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer YOUR_API_KEY"
}
}
}
}
Run in your terminal, or put the JSON in .mcp.json at the project root.
claude mcp add --transport http teams-chat https://market.oshaani.com/teams-chat \
--header "Authorization: Bearer YOUR_API_KEY"
# .mcp.json
{
"mcpServers": {
"teams-chat": {
"type": "http",
"url": "https://market.oshaani.com/teams-chat",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
.vscode/mcp.json (GitHub Copilot agent mode). VS Code prompts for the key once and stores it securely.
{
"inputs": [
{
"type": "promptString",
"id": "oshaani-mcp-key",
"description": "oshaani MCP Marketplace API key",
"password": true
}
],
"servers": {
"teams-chat": {
"type": "http",
"url": "https://market.oshaani.com/teams-chat",
"headers": {
"Authorization": "Bearer ${input:oshaani-mcp-key}"
}
}
}
}
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"teams-chat": {
"serverUrl": "https://market.oshaani.com/teams-chat",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Responses API remote MCP tool (Python SDK).
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-4.1",
tools=[{
"type": "mcp",
"server_label": "teams_chat",
"server_url": "https://market.oshaani.com/teams-chat",
"headers": {"Authorization": "Bearer YOUR_API_KEY"},
"require_approval": "never", # or "always" to approve each tool call
}],
input="What can you do with these tools?",
)
print(response.output_text)
Messages API MCP connector (Python SDK).
import anthropic
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": "What can you do with these tools?"}],
mcp_servers=[{
"type": "url",
"url": "https://market.oshaani.com/teams-chat",
"name": "teams-chat",
"authorization_token": "YOUR_API_KEY",
}],
betas=["mcp-client-2025-04-04"],
)
print(response.content)
Official MCP Python SDK 2.x (pip install mcp); works inside any agent framework.
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import create_mcp_http_client, streamable_http_client
async def main():
headers = {"Authorization": "Bearer YOUR_API_KEY"}
async with create_mcp_http_client(headers=headers) as http:
async with streamable_http_client("https://market.oshaani.com/teams-chat", http_client=http) as (read, write, *_):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
print([tool.name for tool in tools.tools])
asyncio.run(main())
Quick check from a terminal: lists the tools without charging credits.
curl -s https://market.oshaani.com/teams-chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Connection settings
Entered once per connection on market.oshaani.com. Secrets are encrypted and never shown again or sent to agents.
| Setting | Type | Description |
|---|---|---|
Directory (tenant) IDtenant_id
required |
string | pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
Application (client) IDclient_id
required |
string | An Entra ID app registration with the delegated Microsoft Graph permissions listed in the docs pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
Client secretclient_secret
required secret |
string | App registration > Certificates & secrets |
Allow sending messagesallow_sending
|
boolean default false |
Lets agents post in chats and channels and start new chats. Off by default: agents can only read. |
Allowed domains for new chatsallowed_recipient_domains
|
string | Comma-separated, e.g. contoso.com. start_chat refuses people outside these domains. Leave empty to allow any. |
Tools (11)
list_chats
read-only
List the signed-in account's chats, most recent activity first, with members and the last message
| Argument | Type | Description |
|---|---|---|
chat_type |
"oneOnOne" | "group" | "meeting" | Only chats of this type |
top |
integer default 20 |
min 1, max 50 |
get_chat_messages
read-only
Read the latest messages in a chat, oldest first
| Argument | Type | Description |
|---|---|---|
chat_id required |
string | Chat ID from list_chats, e.g. 19:abc...@thread.v2 pattern ^19:[\w.@-]{1,200}$ |
top |
integer default 20 |
Number of messages (max 50) min 1, max 50 |
send_chat_message
Send a message in an existing chat
| Argument | Type | Description |
|---|---|---|
chat_id required |
string | Chat ID from list_chats, e.g. 19:abc...@thread.v2 pattern ^19:[\w.@-]{1,200}$ |
text required |
string | Message text min length 1, max length 28000 |
content_type |
"text" | "html" default "text" |
'html' allows basic formatting such as <b>, <i>, <a>, <ul> |
search_users
read-only
Find people in the organisation by name or email, to start a chat with them
| Argument | Type | Description |
|---|---|---|
query required |
string | min length 2, max length 100 |
top |
integer default 10 |
min 1, max 25 |
start_chat
Start a one-on-one or group chat with people by email and send the first message. Reuses an existing one-on-one chat.
| Argument | Type | Description |
|---|---|---|
emails required |
array of string | Work email or UPN of each person |
text required |
string | Message text min length 1, max length 28000 |
topic |
string | Group chat name; ignored for one-on-one chats max length 250 |
content_type |
"text" | "html" default "text" |
'html' allows basic formatting such as <b>, <i>, <a>, <ul> |
list_teams
read-only
List the teams the signed-in account is a member of
No arguments.
list_channels
read-only
List the channels in a team
| Argument | Type | Description |
|---|---|---|
team_id required |
string | Team ID from list_teams pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
get_channel_messages
read-only
Read the latest posts in a channel, oldest first, optionally with their replies
| Argument | Type | Description |
|---|---|---|
team_id required |
string | Team ID from list_teams pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
channel_id required |
string | Channel ID from list_channels, e.g. 19:abc...@thread.tacv2 pattern ^19:[\w.@-]{1,200}$ |
top |
integer default 20 |
Number of messages (max 50) min 1, max 50 |
include_replies |
boolean default false |
Include each post's replies |
get_message_replies
read-only
Read the replies in a channel thread, oldest first
| Argument | Type | Description |
|---|---|---|
team_id required |
string | Team ID from list_teams pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
channel_id required |
string | Channel ID from list_channels, e.g. 19:abc...@thread.tacv2 pattern ^19:[\w.@-]{1,200}$ |
message_id required |
string | Message ID from a message listing pattern ^\d{10,20}$ |
top |
integer default 50 |
Number of messages (max 50) min 1, max 50 |
send_channel_message
Post a new message in a channel
| Argument | Type | Description |
|---|---|---|
team_id required |
string | Team ID from list_teams pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
channel_id required |
string | Channel ID from list_channels, e.g. 19:abc...@thread.tacv2 pattern ^19:[\w.@-]{1,200}$ |
text required |
string | Message text min length 1, max length 28000 |
subject |
string | Optional post title max length 250 |
content_type |
"text" | "html" default "text" |
'html' allows basic formatting such as <b>, <i>, <a>, <ul> |
reply_to_channel_message
Reply in a channel thread
| Argument | Type | Description |
|---|---|---|
team_id required |
string | Team ID from list_teams pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
channel_id required |
string | Channel ID from list_channels, e.g. 19:abc...@thread.tacv2 pattern ^19:[\w.@-]{1,200}$ |
message_id required |
string | Message ID from a message listing pattern ^\d{10,20}$ |
text required |
string | Message text min length 1, max length 28000 |
content_type |
"text" | "html" default "text" |
'html' allows basic formatting such as <b>, <i>, <a>, <ul> |
Billing & errors
Each successful tool call costs 1 oshaani.com credit. initialize, tools/list, failed calls and timeouts are free.
| JSON-RPC code | Meaning |
|---|---|
-32054 (HTTP 401) | Missing, unknown or revoked API key |
-32053 (HTTP 404) | No Teams Chat connection configured for your organisation, or the connection ID is wrong |
-32055 (HTTP 403) | Connection disabled or origin not allowed |
-32052 (HTTP 429) | Rate limit reached; retry after a minute |
-32050 | Not enough oshaani.com credits for the call |
-32051 | Billing temporarily unavailable; the call was not run |
Errors from Teams Chat itself (bad IDs, permissions) come back as tool results with isError: true so the agent can read and correct them.
See the Teams Chat API documentation.