Cover image
Try Now
2025-03-19

一种原型MCP服务器,可从Microsoft Graph读取用户配置文件。

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

MCP-MSGraph

A prototype MCP (Model Context Protocol) server that reads a user profile from Microsoft Graph.
This project demonstrates how to connect MCP to data stored in Microsoft Graph as a proof of concept.


Create an Azure AD Application

  1. Log into Azure Portal.
  2. Navigate to Azure Active Directory > App registrations > New registration.
  3. Create a new application.
  4. Note the generated Application (client) ID and Client Secret.
  5. Under API permissions, add User.Read.All (as delegated or application permission as appropriate) and grant admin consent.

Instructions to run the server:

  1. Clone the repository or setup your own folder and files structure.

  2. Create a virtual environment:

python3 -m venv venv
source venv/bin/activate
  1. Install the required packages:
pip install fastapi uvicorn requests requests-oauthlib pydantic
  1. Open 'main.py' and replace the placeholder values with your App ID, Tenant ID, and Client Secret.

  2. Start the server

uvicorn main:app --reload

Your server will be available at http://127.0.0.1:8000.


Example Request

Use curl (or any REST client) to send a request to retrieve a user’s profile:

curl -X POST http://localhost:8000/mcp \
  -H "Content-Type: application/json" \
  -d '{
        "action":"readUserProfile",
        "contextId":"abc123",
        "data": {"userId":"someUser@yourtenant.onmicrosoft.com"}
      }'

Result should look something like:

{"status":"success","action":"readUserProfile","contextId":"abc123","data":{"@odata.context":"https://graph.microsoft.com/beta/$metadata#users('adelev%40M365x17584779.onmicrosoft.com')/profile/$entity","id":"profileId","account@odata.context":"https://graph.microsoft.com/beta/$metadata#users('adelev%40M365x17584779.onmicrosoft.com')/profile/account","account":[{"ageGroup":"","countryCode":"","userPrincipalName":"AdeleV@M365x17584779.OnMicrosoft.com","allowedAudiences":"organization","createdDateTime":"2025-01-30T11:06:01.7661211Z","lastModifiedDateTime":"2025-01-30T11:06:01.9431431Z","id":"c74cb3af-2f62-43fa-9709-5d2cfc4b4042","isSearchable":false,"inference":null,"preferredLanguageTag":{"locale":null,"displayName":null},"createdBy":{"user":null,"device":null,"application":{"displayName":"AAD","id":null}},"lastModifiedBy":{"user":null,"device":null,"application":{"displayName":"MsGraph","id":null}},"source":{"type":["AAD","MsGraph"]},"sources":[{"sourceId":"4ce763dd-9214-4eff-af7c-da491cc3782d","isDefaultSource":true},{"sourceId":"0024a795-114d-4031-95c7-5fb543e00e80","properties":["isSipEnabled"]}]},{"ageGroup":"","countryCode":"","userPrincipalName":"","allowedAudiences":"federatedOrganizations","createdDateTime":"2025-01-30T11:06:01.7661213Z","lastModifiedDateTime":"2025-01-30T11:06:01.9431431Z","id":"750f8cc2-2f72-4b38-88c6-531dfc5ed47f","isSearchable":false,"inference":null,"preferredLanguageTag":{"locale":null,"displayName":null},"createdBy":{"user":null,"device":null,"application":{"displayName":"AAD","id":null}},"lastModifiedBy":{"user":null,"device":null,"application":{"displayName":"MsGraph","id":null}},"source":{"type":["AAD","MsGraph"]},"sources":[{"sourceId":"4ce763dd-9214-4eff-af7c-da491cc3782d","isDefaultSource":true},{"sourceId":"0024a795-114d-4031-95c7-5fb543e00e80","properties":["isSipEnabled"]}]}]}}%  

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    4 (1)
    Avatar
    user_RMtTzsRz
    2025-04-15

    Remote MCP Server on Cloudflare by imsardine is an exceptional product for managing your MCP applications seamlessly. The integration with Cloudflare ensures top-notch performance and security, making it a reliable choice for any MCP user. Highly recommended for its ease of use and robust features! Check it out here: https://mcp.so/server/remote-mcp-server/imsardine