Skip to content
Back to search

my_mcp_server

this is the mcp server build and getting integrated with vs code copilot inbuild

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ashwani79891sharma--my-mcp-server/badge.svg)](/listings/ashwani79891sharma--my-mcp-server)

HTML

<a href="/listings/ashwani79891sharma--my-mcp-server"><img src="/api/listings/ashwani79891sharma--my-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 82 lines
  1. Step 1: Start the server
  2. Open the folder in VS Code, open a terminal (Ctrl+`), and run:
  3. cd C:\my-mcp_server
  4. .venv\Scripts\Activate.ps1
  5. python server.py
  6. The server code should end with something like this:
  7. if __name__ == "__main__":
  8. mcp.run(transport="http", host="127.0.0.1", port=8000) # FastMCP 2.x
  9. # with the official mcp SDK, use transport="streamable-http" instead
  10. Leave this terminal running. The output should show the server listening on http://127.0.0.1:8000/mcp. If you open that address in a browser, an error such as “Not Acceptable” is normal, and it shows the server is up.
  11. Step 2: Create .vscode/mcp.json
  12. In the project folder, create .vscode\mcp.json:
  13. {
  14. "servers": {
  15. "my-mcp-server": {
  16. "type": "http",
  17. "url": "http://127.0.0.1:8000/mcp"
  18. }
  19. }
  20. }
  21. The port and the /mcp path must match what the server printed in Step 1.
  22. Step 3: Start the server connection in VS Code
  23. Open mcp.json. A Start link appears above the server name, so click it.
  24. Or press Ctrl+Shift+P, run MCP: List Servers, pick my-mcp-server, and choose Start Server.
  25. If VS Code asks whether you trust the server, read the prompt and choose Trust.
  26. The list should show the server as running with 3 tools. If it fails, choose Show Output in the same menu to read the error.
  27. Step 4: Use it in Copilot Chat
  28. Open Copilot Chat with Ctrl+Alt+I.
  29. Switch the mode dropdown from Ask to Agent. MCP tools only work in Agent mode.
  30. Click the Tools icon in the chat box and check that system_info, list_files and current_time are ticked.
  31. Ask something that needs a tool:
  32. How much free disk space do I have?
  33. What time is it right now?
  34. Copilot shows a confirmation card naming the tool and its inputs. Click Allow (or Continue), and the answer comes back using the tool result. You can also name a tool directly, for example #current_time.
  35. This follows the same pattern as the earlier agent: the model asks for a tool in text, and VS Code runs the call against your server.
  36. Option: let VS Code start the server for you
  37. With HTTP, you start the server yourself each time. For automatic start, use stdio instead. In server.py, change the last line to mcp.run() (stdio is the default), then use this in mcp.json:
  38. {
  39. "servers": {
  40. "my-mcp-server": {
  41. "type": "stdio",
  42. "command": "C:\\my-mcp_server\\.venv\\Scripts\\python.exe",
  43. "args": ["C:\\my-mcp_server\\server.py"]
  44. }
  45. }
  46. }
  47. VS Code launches the process itself. Make sure the server never uses print() to stdout, because that breaks the protocol, and log to stderr instead.
  48. Daily routine (HTTP version)
  49. Open the folder and start python server.py in a terminal.
  50. Start the server in VS Code (the Start link or MCP: List Servers).
  51. Use Agent mode in Copilot Chat.
  52. After editing the server code, stop and restart it, then choose Restart in MCP: List Servers so the tool list refreshes.
  53. Troubleshooting
  54. Connection refused or the server won’t start in VS Code: the Python server isn’t running, or the port or path doesn’t match. Check Step 1 again.
  55. Port already in use: change port=8000 in both server.py and mcp.json, or stop the old process.
  56. Tools don’t appear in chat: confirm you are in Agent mode, check the server shows as running, and restart it.
  57. No MCP option at all: update VS Code and the Copilot extension. If your Copilot account is managed by an organisation, an admin policy can disable MCP servers, so ask your administrator.
  58. ModuleNotFoundError: fastmcp: the environment isn’t active, or the package isn’t installed. Run pip install fastmcp inside .venv.
  59. Keep it safe
  60. Bind to 127.0.0.1 only, as above, so nobody else on your network can reach it.
  61. Keep the tools read-only, and limit list_files to specific folders instead of the whole disk.
  62. Read each tool confirmation before clicking Allow, especially once you add tools that change things.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.