# file-manager-webmcp

> File manager with WebMCP enabled, registering its file operations as tools and handling tool calls.

**Framework:** angular  **Component:** FileManager  **Variant:** webmcp

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/angular/file-manager-webmcp.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-angular-filemanager
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/file-manager-webmcp/file-manager.component.html

```html
<div class="sample-container">
    <ejs-filemanager id="filemanager" [ajaxSettings]="ajaxSettings" [enableWebMcp]="true" [webMcpSettings]="webMcpSettings"
        (beforeWebMcpToolExecute)="beforeWebMcpToolExecute($event)">
    </ejs-filemanager>
</div>

```

### src/components/file-manager-webmcp/file-manager.component.ts

```typescript
import { Component, ViewEncapsulation } from '@angular/core';
import { FileManager, FileManagerAllModule, WebMcpFileManager, NavigationPaneService, ToolbarService, DetailsViewService } from '@syncfusion/ej2-angular-filemanager';

FileManager.Inject(WebMcpFileManager);

/**
 * File Manager WebMCP tools integration sample
 */
@Component({
    selector: 'control-content',
    templateUrl: 'file-manager.component.html',
    styleUrls: ['../file-manager-common.style.css'],
    encapsulation: ViewEncapsulation.None,
    providers: [NavigationPaneService, ToolbarService, DetailsViewService],
    standalone: true,
    imports: [FileManagerAllModule]
})

export class WebMcpController {
    public hostUrl: string = 'https://physical-service.syncfusion.com/';
    public ajaxSettings: object = {
        downloadUrl: this.hostUrl + 'api/FileManager/Download',
        getImageUrl: this.hostUrl + 'api/FileManager/GetImage',
        uploadUrl: this.hostUrl + 'api/FileManager/Upload',
        url: this.hostUrl + 'api/FileManager/FileOperations'
    };
    public webMcpSettings: object = {
        name: 'explorer',
        tools: ['getSelectedFiles', 'manageFileSystemItems', 'manageFileUploadAndDownload'],
        exposedTo: ['https://www.syncfusion.com/']
    };
    public beforeWebMcpToolExecute(args: any): void {
        // Example business rule
        if (args.toolName.includes('manageFileSystemItems')) {
            const hour = new Date().getHours();
            if (hour < 9 || hour > 17) {
                args.cancel = true;
                console.log('File system operations are allowed only between 9:00 AM and 5:00 PM.');
            }
        }
    }
}

```
