File tree Expand file tree Collapse file tree 8 files changed +24
-646
lines changed
Expand file tree Collapse file tree 8 files changed +24
-646
lines changed Original file line number Diff line number Diff line change 2727 " github.copilot-chat"
2828 ],
2929 "settings" : {
30- "python.defaultInterpreterPath" : " ${workspaceFolder}/.venv/bin/python"
30+ "python.defaultInterpreterPath" : " ${workspaceFolder}/.venv/bin/python" ,
31+ "chat.mcp.autostart" : " never"
3132 }
3233 }
3334 },
Original file line number Diff line number Diff line change 11{
22 "version" : " 0.2.0" ,
33 "configurations" : [
4- {
5- "name" : " Launch MCP HTTP Server (Debug)" ,
6- "type" : " debugpy" ,
7- "request" : " launch" ,
8- "program" : " ${workspaceFolder}/basic_mcp_http.py" ,
9- "console" : " integratedTerminal" ,
10- "cwd" : " ${workspaceFolder}" ,
11- "env" : {
12- "PYTHONUNBUFFERED" : " 1"
13- }
14- },
15- {
16- "name" : " Launch MCP stdio Server (Debug)" ,
17- "type" : " debugpy" ,
18- "request" : " launch" ,
19- "program" : " ${workspaceFolder}/basic_mcp_stdio.py" ,
20- "console" : " integratedTerminal" ,
21- "cwd" : " ${workspaceFolder}" ,
22- "env" : {
23- "PYTHONUNBUFFERED" : " 1"
24- }
25- },
264 {
275 "name" : " Attach to MCP Server (stdio)" ,
286 "type" : " debugpy" ,
3715 "remoteRoot" : " ${workspaceFolder}"
3816 }
3917 ]
40- },
41- {
42- "name" : " Attach to MCP Server (HTTP)" ,
43- "type" : " debugpy" ,
44- "request" : " attach" ,
45- "connect" : {
46- "host" : " localhost" ,
47- "port" : 5679
48- },
49- "pathMappings" : [
50- {
51- "localRoot" : " ${workspaceFolder}" ,
52- "remoteRoot" : " ${workspaceFolder}"
53- }
54- ]
5518 }
5619 ]
5720}
Original file line number Diff line number Diff line change 77 "args" : [
88 " run" ,
99 " basic_mcp_stdio.py"
10- ],
11- "env" : {
12- "PYTHONUNBUFFERED" : " 1"
13- }
14- },
15- "expenses-mcp-debug" : {
16- "type" : " stdio" ,
17- "command" : " uv" ,
18- "cwd" : " ${workspaceFolder}" ,
19- "args" : [
20- " run" ,
21- " --" ,
22- " python" ,
23- " -m" ,
24- " debugpy" ,
25- " --listen" ,
26- " 0.0.0.0:5678" ,
27- " basic_mcp_stdio.py"
28- ],
29- "env" : {
30- "PYTHONUNBUFFERED" : " 1"
31- }
10+ ]
3211 },
3312 "expenses-mcp-http" : {
3413 "type" : " http" ,
3514 "url" : " http://localhost:8000/mcp"
3615 },
37- "expenses-mcp-http- debug" : {
16+ "expenses-mcp-debug" : {
3817 "type" : " stdio" ,
3918 "command" : " uv" ,
4019 "cwd" : " ${workspaceFolder}" ,
4524 " -m" ,
4625 " debugpy" ,
4726 " --listen" ,
48- " 0.0.0.0:5679" ,
49- " --wait-for-client" ,
50- " basic_mcp_http.py"
51- ],
52- "env" : {
53- "PYTHONUNBUFFERED" : " 1"
54- }
27+ " 0.0.0.0:5678" ,
28+ " basic_mcp_stdio.py"
29+ ]
5530 }
5631 },
5732 "inputs" : []
Original file line number Diff line number Diff line change 1+ {
2+ "chat.mcp.autostart" : " never"
3+ }
Original file line number Diff line number Diff line change 1414from langchain .agents import create_agent
1515from langchain_core .messages import HumanMessage
1616from langchain_mcp_adapters .client import MultiServerMCPClient
17- from langchain_openai import AzureChatOpenAI , ChatOpenAI
17+ from langchain_openai import ChatOpenAI
1818from pydantic import SecretStr
1919
2020load_dotenv (override = True )
2626 azure .identity .DefaultAzureCredential (),
2727 "https://cognitiveservices.azure.com/.default" ,
2828 )
29- model = AzureChatOpenAI (
30- azure_endpoint = os .environ ["AZURE_OPENAI_ENDPOINT" ],
31- azure_deployment = os .environ ["AZURE_OPENAI_CHAT_DEPLOYMENT" ],
32- api_version = os .environ ["AZURE_OPENAI_VERSION" ],
33- azure_ad_token_provider = token_provider ,
29+ model = ChatOpenAI (
30+ model = os .environ .get ("AZURE_OPENAI_CHAT_DEPLOYMENT" ),
31+ base_url = os .environ ["AZURE_OPENAI_ENDPOINT" ] + "/openai/v1/" ,
32+ api_key = token_provider ,
3433 )
3534elif API_HOST == "github" :
3635 model = ChatOpenAI (
Original file line number Diff line number Diff line change 88from langchain .agents import create_agent
99from langchain_core .messages import HumanMessage , SystemMessage
1010from langchain_mcp_adapters .client import MultiServerMCPClient
11- from langchain_openai import AzureChatOpenAI , ChatOpenAI
11+ from langchain_openai import ChatOpenAI
1212from pydantic import SecretStr
1313from rich .logging import RichHandler
1414
3636 azure .identity .DefaultAzureCredential (),
3737 AZURE_COGNITIVE_SERVICES_SCOPE
3838 )
39- base_model = AzureChatOpenAI (
40- azure_endpoint = os .environ .get ("AZURE_OPENAI_ENDPOINT" ),
41- azure_deployment = os .environ .get ("AZURE_OPENAI_CHAT_DEPLOYMENT" ),
42- api_version = os .environ .get ("AZURE_OPENAI_VERSION" ),
43- azure_ad_token_provider = token_provider ,
39+ base_model = ChatOpenAI (
40+ model = os .environ .get ("AZURE_OPENAI_CHAT_DEPLOYMENT" ),
41+ base_url = os .environ ["AZURE_OPENAI_ENDPOINT" ] + "/openai/v1/" ,
42+ api_key = token_provider ,
4443 )
4544elif API_HOST == "github" :
4645 base_model = ChatOpenAI (
Original file line number Diff line number Diff line change 11[project ]
22name = " python-mcp-demos"
33version = " 0.1.0"
4- description = " Add your description here "
4+ description = " Demonstration of Python FastMCP servers "
55readme = " README.md"
6- requires-python = " >= 3.13"
6+ requires-python = " == 3.13.* "
77dependencies = [
88 " fastmcp>=2.12.5" ,
99 " debugpy>=1.8.0" ,
You can’t perform that action at this time.
0 commit comments