| Framework | MCP integration | Tool filtering? | Example |
|---|---|---|---|
| Langchain | MultiServerMCPClient accepts a dictionary of MCP servers | Filter with get_tools() after connecting to servers | Example |
| Agent-framework | MCPStreamableHTTPTool for each MCP server | Filter with allowed_tools on that class, or tools on agent.run() | Example |
| Pydantic AI | MCPServerStreamableHTTP for each MCP server | Apply .filtered() method to the server and use result as a toolset for agent |
Example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from anthropic import AnthropicFoundry | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| endpoint = "https://pf-claude-foundry-proje-resource.openai.azure.com/anthropic" | |
| deployment_name = "claude-sonnet-4-5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare documents across two Azure AI Search indexes""" | |
| import argparse | |
| import asyncio | |
| import logging | |
| import os | |
| from collections.abc import Iterable, Mapping | |
| from dataclasses import dataclass, field | |
| from typing import Any, cast |
Derived from the original PRD but intentionally simplified for fastest viable implementation. Focus: “folder in, article out” with minimal config, vision-first extraction, and straightforward alignment (no embeddings initially).
Goal: Given a folder containing a deck.pptx (and optionally a transcript + config.yaml), produce article.md plus slide images using a simple CLI: talk2article <folder>.
Included in MVP:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from langchain.agents.middleware import AgentMiddleware, AgentState, ModelRequest | |
| class ToolCallLimitMiddleware(AgentMiddleware): | |
| def __init__(self, limit) -> None: | |
| super().__init__() | |
| self.limit = limit | |
| def modify_model_request( | |
| self, request: ModelRequest, state: AgentState | |
| ) -> ModelRequest: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os | |
| import azure.identity | |
| import openai | |
| from dotenv import load_dotenv | |
| from rich import print | |
| # Setup the OpenAI client to use either Azure, OpenAI.com, or Ollama API | |
| load_dotenv(override=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Find characters whose repetitions tokenize to one token per character with tiktoken. | |
| A character c is considered "stable single-token" if: | |
| len(encode(c)) == 1 AND for all k in [1, max_reps], len(encode(c * k)) == k. | |
| Usage (from repo root with virtual env active): | |
| python find_single_token_char.py | |
| python find_single_token_char.py --model text-embedding-3-large --max-reps 32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import openai | |
| from azure.identity import DefaultAzureCredential, get_bearer_token_provider | |
| client = openai.AzureOpenAI( | |
| api_version=os.environ["AZURE_OPENAI_VERSION"], | |
| azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"], | |
| azure_ad_token_provider=get_bearer_token_provider(DefaultAzureCredential(), | |
| "https://cognitiveservices.azure.com/.default"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import azure.identity | |
| import openai | |
| # Setup the OpenAI client to use either Azure, OpenAI.com, or Ollama API | |
| API_HOST = os.getenv("API_HOST", "azure") | |
| if API_HOST == "azure": | |
| token_provider = azure.identity.get_bearer_token_provider( |